Returns the renderer.

@param array $options

@return \Closure
321831
private function getRenderer(array $options)
    {
        if ($options['text']) {
            if ($options['badge']) {
                return function (TagInterface $tag) {
                    return sprintf(
                        '<span class="label label-%s"><i class="fa fa-%s"></i> %s</span>',
                        $tag->getTheme(), $tag->getIcon(), $tag->getName()
                    );
                };
            } else {
                return function (TagInterface $tag) {
                    return sprintf(
                        '<span class="text-%s"><i class="fa fa-%s"></i> %s</span>',
                        $tag->getTheme(), $tag->getIcon(), $tag->getName()
                    );
                };
            }
        } else {
            if ($options['badge']) {
                return function (TagInterface $tag) {
                    return sprintf(
                        '<span class="label label-%s" title="%s"><i class="fa fa-%s"></i></span>',
                        $tag->getTheme(), $tag->getName(), $tag->getIcon()
                    );
                };
            } else {
                return function (TagInterface $tag) {
                    return sprintf(
                        '<i class="text-%s fa fa-%s" title="%s"></i>',
                        $tag->getTheme(), $tag->getIcon(), $tag->getName()
                    );
                };
            }
        }
    }
29874
public function render(array $options = [])
    {
        $attrs['id'] = $this->getAttribute('controlId', $this->getId() . '-control');
        $attrs['class'] = $this->type . '-field ' . $this->getAttribute('controlClass');

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

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

        $label = !empty($options['no_label']) ? '' : $this->renderLabel($options);
        $input = $this->renderInput($options);

        return $this->wrapElements(new HtmlElement('div', $label . $input, $attrs));
    }
1305798
public function render(array $arguments = [], $renderer = null) {
        $this->runDynamicCallbacks($arguments);

        return $this->baseRender($arguments, $renderer);
    }
1295169
public function reactRenderComponentArrayStatic($componentName, array $options = array())
    {
        $renderer = $this->renderer;
        $this->renderer = $this->staticRenderer;

        $rendered = $this->reactRenderComponentArray($componentName, $options);
        $this->renderer = $renderer;

        return $rendered;
    }
1130702
protected function resolveOptions(array $options)
    {
        if ($this->resolver === null) {
            $this->resolver = new OptionsResolver();
            $this->configureOptions($this->resolver);
        }

        return $this->resolver->resolve($options);
    }
520881
public function renderFragment($uri, $options = [])
    {
        $strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
        unset($options['strategy']);

        return $this->handler->render($uri, $strategy, $options);
    }
844843
public function render(array $options = array())
    {
        $url = $this->service->generateEmbedUrl($this);
        $options = array_replace(array(
            'width' => 560,
            'height' => 315,
            'frameborder' => 0,
            'allowfullscreen' => ''
        ), $options);

        $html = <<<HTML
<iframe src="$url" width="{$options['width']}" height="{$options['height']}" frameborder="{$options['frameborder']}" {$options['allowfullscreen']}></iframe>
HTML;
        return $html;
    }
522725
protected function createHighLighter($options)
	{
		if(!class_exists('Text_Highlighter', false))
		{
			require_once(Yii::getPathOfAlias('system.vendors.TextHighlighter.Text.Highlighter').'.php');
			require_once(Yii::getPathOfAlias('system.vendors.TextHighlighter.Text.Highlighter.Renderer.Html').'.php');
		}
		$lang = current(preg_split('/\s+/', substr(substr($options,1), 0,-1),2));
		$highlighter = Text_Highlighter::factory($lang);
		if($highlighter)
			$highlighter->setRenderer(new Text_Highlighter_Renderer_Html($this->getHighlightConfig($options)));
		return $highlighter;
	}
956115
public function renderValue($data, array $options = []) : string
    {
        $options = array_merge($this->defaultOptions, $this->fixOptions($options));
        $result = $this->getFieldValueFromData($data, $options);

        // Currently needed for blobs from the database, but might be handy later
        // for network data and such.
        // TODO: Add support for encoding (base64, et) via $options
        if (is_resource($result)) {
            $result = stream_get_contents($result);
        }

        $rendererClass = $this->config->getProvider('renderValue');
        if (!empty($options['renderAs'])) {
            $rendererClass = __NAMESPACE__ . '\\Provider\\RenderValue\\' . ucfirst($options['renderAs']) . 'Renderer';
        }

        if (!class_exists($rendererClass)) {
            throw new InvalidArgumentException("Renderer class [$rendererClass] does not exist");
        }

        $rendererClass = new $rendererClass($this->config);
        $result = (string)$rendererClass->provide($result, $options);

        return $result;
    }
539070
public function render($options = array())
    {
        $alert = $this->alertManager->getAlert();
        $options['alerts'] = $alert ? $alert->all() : array();

        return $this->alertHelper->render($options, $this->getTemplate($options));
    }
6840
public function render($video, $options = array()) {
        $helper = $this->_getSpecializedHelper($video);
        return $helper->render($video, $options);
    }
1308183
public function renderMenu($name, array $options = [], $renderer = null)
    {
        if (null === $menu = $this->menuProvider->findByName($name)) {
            throw new \InvalidArgumentException(sprintf('Menu named "%s" not found.', $name));
        }

        // Tags the response as Menu relative
        $this->tagManager->addTags([
            Menu::getEntityTagPrefix(),
            sprintf('%s[id:%s]', Menu::getEntityTagPrefix(), $menu['id']),
        ]);

        return $this->menuHelper->render($name, $options, $renderer);
    }
513739
public function def(array $options=[]) {
		if(!$this->widget)
			throw new \Exception('No default render function for this field');
		return $this->render($this->widget, $options);
	}
19851
protected function getUrlAction($options)
    {
        if (is_array($options)) {
            return $this->url->to($options[0], array_slice($options, 1));
        }

        return $this->url->to($options);
    }
1316534
protected function renderOptionTags($options)
    {
        if ($this->arguments['nothingSelectedLabel'] !== null) {
            $this->arguments['prependOptionLabel'] = $this->arguments['nothingSelectedLabel'];
        }
        if ($this->arguments['required']) {
            $this->tag->addAttribute('required', 'required');
        }
        return parent::renderOptionTags($options);
    }
385954
protected function generatePatterns($options = array()) {

		// set-up the dispatcher
		$dispatcherInstance = Dispatcher::getInstance();

		// note the beginning of the operation
		$dispatcherInstance->dispatch("builder.generatePatternsStart");

		// set-up common vars
		$exportFiles      = (isset($options["exportFiles"]) && $options["exportFiles"]);
		$exportDir        = Config::getOption("exportDir");
		$patternPublicDir = !$exportFiles ? Config::getOption("patternPublicDir") : Config::getOption("patternExportDir");
		$patternSourceDir = Config::getOption("patternSourceDir");
		$patternExtension = Config::getOption("patternExtension");
		$suffixRendered   =	Config::getOption("outputFileSuffixes.rendered");
		$suffixRaw        = Config::getOption("outputFileSuffixes.rawTemplate");
		$suffixMarkupOnly = Config::getOption("outputFileSuffixes.markupOnly");

		// make sure the export dir exists
		if ($exportFiles && !is_dir($exportDir)) {
			mkdir($exportDir);
		}

		// make sure patterns exists
		if (!is_dir($patternPublicDir)) {
			mkdir($patternPublicDir);
		}

		// loop over the pattern data store to render the individual patterns
		$store = PatternData::get();
		foreach ($store as $patternStoreKey => $patternStoreData) {

			if (($patternStoreData["category"] == "pattern") && isset($patternStoreData["hidden"]) && (!$patternStoreData["hidden"])) {

				$path          = $patternStoreData["pathDash"];
				$pathName      = (isset($patternStoreData["pseudo"])) ? $patternStoreData["pathOrig"] : $patternStoreData["pathName"];

				// modify the pattern mark-up
				$markup        = $patternStoreData["code"];
				$markupFull    = $patternStoreData["header"].$markup.$patternStoreData["footer"];
				$markupEngine  = file_get_contents($patternSourceDir."/".$pathName.".".$patternExtension);

				// if the pattern directory doesn't exist create it
				if (!is_dir($patternPublicDir."/".$path)) {
					mkdir($patternPublicDir."/".$path);
				}

				// write out the various pattern files
				file_put_contents($patternPublicDir."/".$path."/".$path.$suffixRendered.".html",$markupFull);
				if (!$exportFiles) {
					file_put_contents($patternPublicDir."/".$path."/".$path.$suffixMarkupOnly.".html",$markup);
					file_put_contents($patternPublicDir."/".$path."/".$path.$suffixRaw.".".$patternExtension,$markupEngine);
				}

			}

		}

		// note the end of the operation
		$dispatcherInstance->dispatch("builder.generatePatternsEnd");

	}
730888
public function render(ItemInterface $item, array $options = []): string
    {
        return $this->engine->render($options['template'], ['menu' => $item, 'options' => $options]);
    }