Use the default renderer.
@param  array $options
@return string|Widget
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);
	}
420070
protected function doRender(array $options)
    {
        if (!isset($this->templateEngine)) {
            throw new InvalidArgumentException('Missing template engine');
        }

        if (!isset($this->label)) {
            throw new InvalidArgumentException('Missing provider label');
        }

        if (isset($options[$this->label])) {
            $options = array_merge($this->options, $options[$this->label], $options);
            unset($options[$this->label]);
        } else {
            $options = $options + $this->options;
        }

        $template = sprintf(
            'EzSystemsShareButtonsBundle::%s/%s',
            $this->templateName,
            $options['template']
        );

        return $this->templateEngine->render($template, $options);
    }
470764
protected function _initializationOptions($options = array()) {
		$defaults = array(
			'_buffer' => true,
			'_css' => true,
			'_cssText' => true,
			'_scripts' => true,
			'_scriptBlock' => false,
			'_editor' => true,
			'_inline' => true,
		);

		return json_encode(array_diff_key(array_merge(
			$defaults,
			(array)$options
		), $defaults));
	}
852758
protected function processOptions(array $options)
    {
        $resolver = new OptionsResolver();
        $this->setDefaultOptions($resolver);

        return $resolver->resolve($options);
    }
1363945
public function render(array $options = [])
    {
        if (profiler() !== false) {
            profiler()->watch('Starting View Rendering');
        }

        parser()->loadVars(presenter()->getArrayCopy());

        if (presenter()->page->file instanceof \SplFileInfo) {

            if (false === ($pagePresets = presenter()->page->getPresets())) {
                if (presenter()->page->file->getFilename() === 'index') {
                    $title = presenter()->page->file->getDirectoryInfo()->getDirName();
                } else {
                    $titles[] = presenter()->page->file->getDirectoryInfo()->getDirName();
                    $titles[] = presenter()->page->file->getFilename();

                    $title = implode(' - ', array_unique($titles));
                }

                $pagePresets = new SplArrayObject([
                    'title'  => readable($title, true),
                    'access' => 'public',
                ]);
            }

            /**
             * Sets Page Theme
             */
            if ($pagePresets->offsetExists('theme')) {
                presenter()->setTheme($pagePresets->theme);
            } elseif (false !== ($theme = presenter()->getConfig('theme'))) {
                if (modules()->top()->hasTheme($theme)) {
                    presenter()->setTheme($theme);
                }
            }

            /**
             * Sets Page Layout
             */
            if (presenter()->theme !== false) {
                if ($pagePresets->offsetExists('layout')) {
                    presenter()->theme->setLayout($pagePresets->layout);
                }

                /**
                 * Autoload Theme Assets
                 */
                presenter()->theme->load();

                if (false !== ($modulePresets = modules()->top()->getPresets())) {

                    /**
                     * Autoload Module Assets
                     */
                    if ($modulePresets->offsetExists('assets')) {
                        presenter()->assets->autoload($modulePresets->assets);
                    }

                    /**
                     * Sets Module Meta
                     */
                    if ($modulePresets->offsetExists('title')) {
                        presenter()->meta->title->append(language()->getLine($modulePresets->title));
                    }

                    if ($modulePresets->offsetExists('pageTitle')) {
                        presenter()->meta->title->replace(language()->getLine($modulePresets->pageTitle));
                    }

                    if ($modulePresets->offsetExists('browserTitle')) {
                        presenter()->meta->title->replace(language()->getLine($modulePresets->browserTitle));
                    }

                    if ($modulePresets->offsetExists('meta')) {
                        foreach ($modulePresets->meta as $name => $content) {
                            presenter()->meta->store($name, $content);
                        }
                    }
                }

                $moduleAssets = [
                    'app',
                    'module',
                    modules()->top()->getParameter(),
                ];

                // Autoload Assets
                presenter()->assets->loadCss($moduleAssets);
                presenter()->assets->loadJs($moduleAssets);

                /**
                 * Autoload Page Assets
                 */
                if ($pagePresets->offsetExists('assets')) {
                    presenter()->assets->autoload($pagePresets->assets);
                }

                if (presenter()->page->file instanceof \SplFileInfo) {
                    $pageDir = presenter()->page->file->getRealPath();
                    $pageDir = str_replace('.' . pathinfo($pageDir, PATHINFO_EXTENSION), '', $pageDir);

                    $pageDirParts = explode('pages' . DIRECTORY_SEPARATOR,
                        str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $pageDir));
                    $pageDir = end($pageDirParts);

                    presenter()->assets->addFilePath(reset($pageDirParts) . 'pages' . DIRECTORY_SEPARATOR);

                    $pageDir = rtrim($pageDir, DIRECTORY_SEPARATOR);
                    $pageDirParts = explode(DIRECTORY_SEPARATOR, $pageDir);

                    $totalParts = count($pageDirParts);

                    for ($i = 0; $i < $totalParts; $i++) {
                        $pageAssets[] = implode(DIRECTORY_SEPARATOR, array_slice($pageDirParts, 0, ($totalParts - $i)));
                    }

                    $pageAssets[] = implode(DIRECTORY_SEPARATOR, [end($pageAssets), end($pageAssets)]);

                    // Autoload Assets
                    presenter()->assets->loadCss($pageAssets);
                    presenter()->assets->loadJs($pageAssets);
                }

                /**
                 * Sets Page Meta
                 */
                if ($pagePresets->offsetExists('title')) {
                    presenter()->meta->title->append(language()->getLine($pagePresets->title));
                }

                if ($pagePresets->offsetExists('pageTitle')) {
                    presenter()->meta->title->replace(language()->getLine($pagePresets->pageTitle));
                }

                if ($pagePresets->offsetExists('browserTitle')) {
                    presenter()->meta->title->replace(language()->getLine($pagePresets->browserTitle));
                }

                if ($pagePresets->offsetExists('meta')) {
                    foreach ($pagePresets->meta as $name => $content) {
                        presenter()->meta->store($name, $content);
                    }
                }

                if (false !== ($layout = presenter()->theme->getLayout())) {
                    parser()->loadFile($layout->getRealPath());

                    $htmlOutput = parser()->parse();
                    $htmlOutput = presenter()->assets->parseSourceCode($htmlOutput);

                    $this->document->loadHTML($htmlOutput);
                }
            } else {
                output()->sendError(204, language()->getLine('E_THEME_NOT_FOUND', [$theme]));
            }
        } elseif (presenter()->theme instanceof Theme) {
            /**
             * Autoload Theme Assets
             */
            presenter()->theme->load();

            if (false !== ($modulePresets = modules()->top()->getPresets())) {

                /**
                 * Autoload Module Assets
                 */
                if ($modulePresets->offsetExists('assets')) {
                    presenter()->assets->autoload($modulePresets->assets);
                }

                /**
                 * Sets Module Meta
                 */
                if ($modulePresets->offsetExists('title')) {
                    presenter()->meta->title->append(language()->getLine($modulePresets->title));
                }

                if ($modulePresets->offsetExists('pageTitle')) {
                    presenter()->meta->title->replace(language()->getLine($modulePresets->pageTitle));
                }

                if ($modulePresets->offsetExists('browserTitle')) {
                    presenter()->meta->title->replace(language()->getLine($modulePresets->browserTitle));
                }

                if ($modulePresets->offsetExists('meta')) {
                    foreach ($modulePresets->meta as $name => $content) {
                        presenter()->meta->store($name, $content);
                    }
                }
            }

            $moduleAssets = [
                'app',
                'module',
                modules()->top()->getParameter(),
            ];

            // Autoload Assets
            presenter()->assets->loadCss($moduleAssets);
            presenter()->assets->loadJs($moduleAssets);

            /**
             * Autoload Controller Assets
             */
            $controllerFilename = str_replace([modules()->top()->getDir('Controllers'), '.php'], '',
                controller()->getFileInfo()->getRealPath());
            $controllerFilename = dash($controllerFilename);
            $controllerAssets[] = $controllerFilename;
            $controllerAssets[] = implode('/', [
                $controllerFilename,
                controller()->getRequestMethod(),
            ]);

            presenter()->assets->loadCss($controllerAssets);
            presenter()->assets->loadJs($controllerAssets);

            if (false !== ($layout = presenter()->theme->getLayout())) {
                parser()->loadFile($layout->getRealPath());

                $htmlOutput = parser()->parse();
                $htmlOutput = presenter()->assets->parseSourceCode($htmlOutput);

                $this->document->loadHTML($htmlOutput);
            }
        } elseif (false !== ($theme = presenter()->getConfig('theme'))) {
            if (modules()->top()->hasTheme($theme)) {
                presenter()->setTheme($theme);

                /**
                 * Autoload Theme Assets
                 */
                presenter()->theme->load();

                if (false !== ($modulePresets = modules()->top()->getPresets())) {

                    /**
                     * Autoload Module Assets
                     */
                    if ($modulePresets->offsetExists('assets')) {
                        presenter()->assets->autoload($modulePresets->assets);
                    }

                    /**
                     * Sets Module Meta
                     */
                    if ($modulePresets->offsetExists('title')) {
                        presenter()->meta->title->append(language()->getLine($modulePresets->title));
                    }

                    if ($modulePresets->offsetExists('pageTitle')) {
                        presenter()->meta->title->replace(language()->getLine($modulePresets->pageTitle));
                    }

                    if ($modulePresets->offsetExists('browserTitle')) {
                        presenter()->meta->title->replace(language()->getLine($modulePresets->browserTitle));
                    }

                    if ($modulePresets->offsetExists('meta')) {
                        foreach ($modulePresets->meta as $name => $content) {
                            presenter()->meta->store($name, $content);
                        }
                    }
                }

                $moduleAssets = [
                    'app',
                    'module',
                    modules()->top()->getParameter(),
                ];

                // Autoload Assets
                presenter()->assets->loadCss($moduleAssets);
                presenter()->assets->loadJs($moduleAssets);

                /**
                 * Autoload Controller Assets
                 */
                $controllerFilename = str_replace([modules()->top()->getDir('Controllers'), '.php'], '',
                    controller()->getFileInfo()->getRealPath());
                $controllerFilename = dash($controllerFilename);
                $controllerAssets[] = $controllerFilename;
                $controllerAssets[] = implode('/', [
                    $controllerFilename,
                    controller()->getRequestMethod(),
                ]);

                if (false !== ($layout = presenter()->theme->getLayout())) {
                    parser()->loadFile($layout->getRealPath());

                    $htmlOutput = parser()->parse();
                    $htmlOutput = presenter()->assets->parseSourceCode($htmlOutput);

                    $this->document->loadHTML($htmlOutput);
                }
            } else {
                output()->sendError(204, language()->getLine('E_THEME_NOT_FOUND', [$theme]));
            }
        } else {
            $this->document->find('body')->append(presenter()->partials->__get('content'));
        }

        /**
         * Set Document Meta Title
         */
        if (presenter()->meta->title instanceof Meta\Title) {
            $this->document->title->text(presenter()->meta->title->__toString());
        }

        /**
         * Injecting Meta Opengraph
         */
        if (presenter()->meta->opengraph instanceof Meta\Opengraph) {
            // set opengraph title
            if (presenter()->meta->title instanceof Meta\Title) {
                presenter()->meta->opengraph->setTitle(presenter()->meta->title->__toString());
            }

            // set opengraph site name
            if (presenter()->exists('siteName')) {
                presenter()->meta->opengraph->setSiteName(presenter()->offsetGet('siteName'));
            }

            if (presenter()->meta->opengraph->count()) {
                $htmlElement = $this->document->getElementsByTagName('html')->item(0);
                $htmlElement->setAttribute('prefix', 'og: ' . presenter()->meta->opengraph->prefix);

                if (presenter()->meta->opengraph->exists('og:type') === false) {
                    presenter()->meta->opengraph->setType('website');
                }

                $opengraph = presenter()->meta->opengraph->getArrayCopy();

                foreach ($opengraph as $tag) {
                    $this->document->metaNodes->createElement($tag->attributes->getArrayCopy());
                }
            }
        }

        if (presenter()->meta->count()) {
            $meta = presenter()->meta->getArrayCopy();

            foreach ($meta as $tag) {
                $this->document->metaNodes->createElement($tag->attributes->getArrayCopy());
            }
        }

        /**
         * Inject body attributes
         */
        $body = $this->document->getElementsByTagName('body');
        $body->item(0)->setAttribute('module', modules()->top()->getParameter());

        /**
         * Injecting Single Sign-On (SSO) iFrame
         */
        if (services()->has('user')) {
            $iframe = services()->get('user')->getIframeCode();

            if ( ! empty($iframe)) {
                $this->document->find('body')->append($iframe);
            }
        }

        if (input()->env('DEBUG_STAGE') === 'DEVELOPER' and
            presenter()->getConfig('debugToolBar') === true and
            services()->has('profiler')
        ) {
            $this->document->find('body')->append((new Toolbar())->__toString());
        }

        /**
         * Injecting Progressive Web Application (PWA) Manifest
         */
        $this->document->linkNodes->createElement([
            'rel'  => 'manifest',
            'href' => '/manifest.json',
        ]);

        $htmlOutput = $this->document->saveHTML();

        // Uglify Output
        if ($this->config->output[ 'uglify' ] === true) {
            $htmlOutput = preg_replace(
                [
                    '/\>[^\S ]+/s',     // strip whitespaces after tags, except space
                    '/[^\S ]+\</s',     // strip whitespaces before tags, except space
                    '/(\s)+/s',         // shorten multiple whitespace sequences
                    '/<!--(.|\s)*?-->/', // Remove HTML comments
                    '/<!--(.*)-->/Uis',
                    "/[[:blank:]]+/",
                ],
                [
                    '>',
                    '<',
                    '\\1',
                    '',
                    '',
                    ' ',
                ],
                str_replace(["\n", "\r", "\t"], '', $htmlOutput));
        }

        // Beautify Output
        if ($this->config->output[ 'beautify' ] === true) {
            $beautifier = new Html\Dom\Beautifier();
            $htmlOutput = $beautifier->format($htmlOutput);
        }

        if (profiler() !== false) {
            profiler()->watch('Ending View Rendering');
        }

        return $htmlOutput;
    }
1193889
function MDRenderer(options) {
  this.options = options || {};

  this.options.renderer = new marked.Renderer();
  Object.keys(renderFunc).forEach(function(key) {
    this.options.renderer[key] = renderFunc[key];
  }, this);

  return this;
}
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;
    }
722229
public function setOptions($options) {
		$this->renderer->getElement()->setOptions($options);
		$this->renderer->getHtmlElement()->setOptions($options);
	}
646849
protected function renderRemoveButton($options = [])
    {
        $options = array_replace_recursive([
            'class' => 'btn btn-box-tool',
            'data-widget' => 'remove',
        ], $options);

        return Html::button(FA::i('times'), $options);
    }
1060236
private function getFormat(array $options)
    {
        if (isset($options[self::PARAM_FORMAT])) {
            return $options[self::PARAM_FORMAT];
        } else {
            return $this->defaultFormat;
        }
    }
1241531
protected function renderBrand(array $options)
    {
        $brandLabel = $options['brand'];
        $brandLink  = '#';
        if (is_array($options['brand'])) {
            if (isset($options['brand']['route'])) {
                $urlHelper = $this->view->plugin('url');
                $brandLink = $urlHelper($options['brand']['route']);
            } elseif (isset($options['brand']['uri'])) {
                $brandLink = $options['brand']['uri'];
            }
            
            $brandLabel = '';
            if (isset($options['brand']['icon'])) {
                $iconHelper = $this->getIconHelper();
                $brandLabel .= $iconHelper($options['brand']['icon']) . ' ';
            }
            $brandLabel .= $options['brand']['label'];
        }
        
        return '<a class="navbar-brand" href="' . $brandLink . '">'
            . $brandLabel . '</a>';
    }
109663
public function renderOption(Option $opt): string
    {
        $columns = [];
        if ($opt->short) {
            $columns[] = $this->formatter->format('-' . $opt->short, 'strong_white')
                . $this->renderOptionValueHint($opt, false);
        }
        if ($opt->long) {
            $columns[] = $this->formatter->format('--' . $opt->long, 'strong_white')
                . $this->renderOptionValueHint($opt, true);
        }

        return implode(', ', $columns);
    }
299307
public function prepare($options = [])
    {
        if (request()->ajax()) {
            return $this->getArray($options);
        }

        return $this->getHtml($options);
    }
154192
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
        $options = static::_replaceJsExpr($options, $jsExpressions);

        //TODO: Check for encoding errors
        $result = json_encode($options);

        //Replace any js expression on the json_encoded string
        foreach ($jsExpressions as $key => $expr) {
            $result = str_replace('"' . $key . '"', $expr, $result);
        }
        return $result;
    }
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;
	}
919491
public function create(array $options = [])
    {
        $printer = new PrettyPrinter();

        $parser = $this->getParser();

        $options = array_merge(['dir' => true, 'file' => true, 'skip' => false, 'strict' => false], $options);

        $traverser = $this->getTraverser($options['dir'], $options['file'], $options['skip'], $options['strict']);

        return new ClassPreloader($printer, $parser, $traverser);
    }
122939
public function render($options = array())
    {
        $options = array_merge($this->defaultOptions, $options);
        return $this->view->make('shareable::twitter', array('options' => $options));
    }