Attributes::render

@param array $options

@return string
10441
public function render(array $options = [])
    {
        $output = '';

        if ($this->count()) {
            foreach ($this->storage as $key => $value) {
                $output = trim($output);
                switch ($key) {
                    case 'style':
                        if (count($value) == 0) {
                            continue;
                        }

                        $output .= 'style="';
                        foreach ($value as $styleKey => $styleValue) {
                            $output .= $styleKey . ':' . $styleValue . ';';
                        }
                        $output .= '"';

                        break;
                    case 'class':
                        if (count($value) == 0) {
                            continue;
                        }
                        $output .= ' ' . $key . '="' . implode(' ', $value) . '"';
                        break;
                    case 'js':
                        $output .= ' ' . $key . '="' . $value . '"';
                        break;
                    default:
                        if (is_array($value)) {
                            if (count($value) == 0) {
                                continue;
                            }
                            $value = implode(', ', $value);
                        }

                        if (is_bool($value)) {
                            $value = $value === true ? 'true' : 'false';
                        }

                        if (in_array($key, [
                            'controls',
                            'disabled',
                            'readonly',
                            'autocomplete',
                            'checked',
                            'loop',
                            'autoplay',
                            'muted',
                        ])) {
                            $output .= ' ' . $key;
                        } else {
                            $output .= ' ' . $key . '="' . $value . '"';
                        }
                        break;
                }
            }
        }

        return $output;
    }
1018386
public function render(array $options = []): string
    {
        $html = $this->format['menuStart'];
        $html .= !empty($options['title']) ? $options['title'] : '';

        /**
         * @var MenuItemInterface $menuItem
         */
        foreach ($this->menu->getMenuItems() as $menuItem) {
            if ($menuItem->isEnabled()) {
                $html .= $this->renderMenuItem($menuItem);
            }
        }
        $html .= $this->format['menuEnd'];

        return $html;
    }
81947
protected function _renderAttributes(array $attributes = [])
    {
        $attributeStrings = [];
        foreach ($attributes as $attribute => $value) {
            $attributeStrings[] = $attribute . '="' . htmlentities($value) . '"';
        }

        if (empty($attributeStrings)) {
            return '';
        }

        return ' ' . join(' ', $attributeStrings);
    }
957274
public static function render($options) {
        $jsExpressions = array();
        //Replace any js expression with random strings so we can switch
        //them back after json_encode the options
        $optionsJsExpr = static::replaceJsExpr($options, $jsExpressions);
        //TODO: Check for encoding errors
        $result = json_encode($optionsJsExpr);
        //Replace any js expression on the json_encoded string
        foreach ($jsExpressions as $key => $expr) {
            $result = str_replace('"' . $key . '"', $expr, $result);
        }
        return $result;
    }
817282
public function render($options = array())
    {
        $this->configure($options + $this->getDefaultConfiguration());

        $content = $this->parseCurrentContent();

        if ((bool)$this->getConfig('end')) {
            // Only play with headers when we know we will
            // kill the process.
            $this->applyHeaders();

            echo $content;
            Strata::router()->route->end();
            exit();
        }

        echo $content;
    }
932031
public function renderAttributes() : string
    {
        $pairs = array_map(function(string $value, string $key) {
            return sprintf('%s="%s"', helpers\e($key), helpers\e($value));
        }, $this->attributes, array_keys($this->attributes));

        return implode(' ', $pairs);
    }
1152937
public function render($options = [ ])
    {
        $mergedOptions = array_merge($this->config['options'], $options);

        $data = [
            'public_key' => value($this->config['public_key']),
            'options'    => $mergedOptions,
            'dataParams' => $this->extractDataParams($mergedOptions),
        ];

        if (array_key_exists('lang', $mergedOptions) && "" !== trim($mergedOptions['lang'])) {
            $data['lang'] = $mergedOptions['lang'];
        }

        $view = $this->getView($options);

        return app('view')->make($view, $data);
    }
205730
public function render($options = array()) {
        $options = array_merge($this->_defaults, $options);
        $markers = $this->getMarkersAsString($options);
        $img = '';

        $img .= '<img src="http://maps.google.com/maps/api/staticmap';
        $img .= '?center=' . $options['location']['lat'] . ',' . $options['location']['lng'];
        $img .= '&amp;zoom=' . $options['zoomLevel'];
        $img .= '&amp;size=' . $options['width'] . 'x' . $options['height'];
        $img .= '&amp;maptype=' . $options['mapType'];
        $img .= ($markers ? '&amp;markers=' . $markers : '');
        $img .= '&amp;sensor=' . ($options['sensor'] ? 'true' : 'false') . '" ';
        $img .= 'width="' . $options['width'] . '" height="' . $options['height'] . '" alt="';
        $img .= $options['altText'] . '" class="g-googlemap" />';

        $this->view->script()->src(
            'https://www.google.com/maps/api/js?sensor=' . ($options['sensor'] ? 'true' : 'false')
        );
        return $img;
    }
133910
public static function renderJs($options = []) {
		$result = '';
		$list = [];
		$js = Application::get(['layout', 'js']);
		if (!empty($js)) {
			asort($js);
			foreach ($js as $k => $v) {
				$script = $k . (strpos($k, '?') !== false ? '&' : '?') . self::getVersion();
				$list[] = $script;
				$js_options = Application::get(['layout', 'js_options', $k]) ?? [];
				if (empty($js_options)) {
					$js_options['crossorigin'] = 'anonymous';
				}
				$js_options['type'] = 'text/javascript';
				$js_options['src'] = $script;
				$result.= \HTML::script($js_options);
			}
		}
		// list is needed for ajax form reloads
		if (!empty($options['return_list'])) {
			return $list;
		}
		return $result;
	}
1057450
public function renderCloseButton($options = [])
    {
        if (!isset($options['id'])) {
            $options['id'] = $this->getId() . '-close-button';
        }

        $this->getView()->registerJs('
        jQuery("#' . $options['id'] . '").on("click", function(event) {
            jQuery("#' . $this->getId() . '").fadeOut();
        });
        ');

        return Elements::icon('close', $options);
    }
727638
public function render($options = array())
    {
        $options = array_merge($this->defaultOptions, $options);
        if ($options['size'] === 'small')
            $options['height'] = 15;
        elseif ($options['size'] === 'large')
            $options['height'] = 24;
        else
            $options['height'] = '';

        return $this->view->make('shareable::google_plus', array('options' => $options));
    }
1163408
public function getHtml(array $attributes = []): string
    {
        $optionsHtml = '';
        foreach ($this->options as $option) {
            $optionsHtml .= $option->getHtml();
        }

        return self::buildTag('select', $optionsHtml,
            array_merge(
                [
                    'name'     => $this->getName(),
                    'required' => $this->isRequired() && $this->hasEmptyOption,
                ],
                $attributes
            ), true
        );
    }
303247
public function renderLabel(array $options = [])
    {
        $attrs['id'] = $this->getAttribute('labelId', $this->getId() . '-label');
        $attrs['class'] = $this->getAttribute('labelClass');
        $attrs['for'] = $this->getAttribute('for', $this->getId());
        $attrs['title'] = $this->getAttribute('description');

        $attrs = array_merge($attrs, (array) $this->getAttribute('labelAttribs'));

        if ($this->form && $this->form->getRenderer()) {
            return $this->form->getRenderer()->renderLabel($this, $attrs, $options);
        }

        $label = $this->getLabel();

        if ($this->required) {
            $label = '<span class="windwalker-input-required-hint">*</span> ' . $label;
        }

        return (string) new HtmlElement('label', $label, $attrs);
    }
617953
public function render($actionName, array $attributes = array(), array $options = array())
    {
        $controller = 'PablodipModuleBundle:Module:execute';

        $attributes['_module.module'] = get_class($this->module);
        $attributes['_module.action'] = $actionName;

        $options['attributes'] = $attributes;

        return $this->module->getContainer()->get('http_kernel')->render($controller, $options);
    }
452320
public function prepareAttributes($options)
    {
        if (!$options) {
            return null;
        }

        $attributes = [];

        foreach ($options as $name => $option) {
            if ($option !== null) {
                $name = is_numeric($name) ? $option : $name;
                $attributes[] = $name.'="'.$option.'" ';
            }
        }

        return join('', $attributes);
    }
393908
public function render($template, $options = array())
  {
    $pre_render = view($template, $options);
    $md = new \Parsedown();

    return $md->text($pre_render);
  }
1035739
protected function generateRenderOptions(array &$options)
    {
        $i18n = $this->controller->getService('i18n');
        $defaultLocales = $i18n->fallbacks();
        array_unshift($defaultLocales, $i18n->defaultLocale());
        
        $format = $this->controller->request() ?
            $this->controller->request()->format() :
            null;
        
        if (isset($options['details'])) {
            $details = $options['details'];
        } else {
            $details = [];
        }
        
        if (!isset($details['formats'])) {
            $details['formats'] = [];
        }
        if ($format) {
            $details['formats'][] = $format;
        }
        
        if (!isset($details['handlers'])) {
            $details['handlers'] = [];
        }
        $details['handlers'] = array_merge(
            array_keys($this->actionView()->handlers()),
            $details['handlers']
        );
        
        if (!isset($details['locale'])) {
            $details['locale'] = [];
        }
        $details['locale'] = array_merge($defaultLocales, $details['locale']);
        
        $options['details'] = $details;
        
        $layout = $this->controller->layout();
        if ($layout === null) {
            $options['layout'] = 'application';
        } elseif (is_string($layout)) {
            $options['layout'] = $layout;
        }
    }