renderStyles

@param bool  $withInternal
@param array $internalAttrs

@return string
430428
public function renderStyles($withInternal = false, array $internalAttrs = [])
    {
        $html = [];

        Ioc::getApplication()->triggerEvent('onAssetRenderStyles', [
            'asset' => $this,
            'withInternal' => &$withInternal,
            'html' => &$html,
        ]);

        foreach ($this->styles as $url => $style) {
            $defaultAttribs = [
                'href' => $style['url'],
                'rel' => 'stylesheet',
            ];

            $attribs = array_merge($defaultAttribs, $style['attribs']);

            if ($style['options']['version'] !== false) {
                $attribs['href'] = $this->appendVersion($attribs['href']);
            }

            if (isset($style['options']['sri'])) {
                $attribs['integrity']   = $style['options']['sri'];
                $attribs['crossorigin'] = 'anonymous';
            }

            if (isset($style['options']['conditional'])) {
                $html[] = '<!--[if ' . $style['options']['conditional'] . ']>';
            }

            $html[] = (string) h('link', $attribs, null);

            if (isset($style['options']['conditional'])) {
                $html[] = '<![endif]-->';
            }
        }

        if ($withInternal && $this->internalStyles) {
            $html[] = (string) h(
                'style',
                $internalAttrs,
                "\n" . $this->renderInternalStyles() . "\n" . $this->indents
            );
        }

        return implode("\n" . $this->indents, $html);
    }
585769
public function renderFormCollection($params, $content, \Smarty_Internal_Template $template, &$repeat)
    {
        /**
         * Get parameters
         */
        $form = $this->getInstanceFromParams($params);
        $row = $this->getSymfonyFormFromParams($params, "row");
        $collection = $this->resolveCollection($this->getParam($params, "collection"), $form);

        $hash = $this->initializeCollection($form, $collection, $row);

        $limit = $this->getParam($params, "limit", -1);

        /**
         * Check if it has a limit
         */
        if (!preg_match("#^\-?\d+$#", $limit)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'limit' parameter in 'form_collection'. '%s' given, integer expected",
                    $limit
                )
            );
        }

        /**
         * Then load stack and create the stack count
         */
        $limit = (int)$limit;
        $hasLimit = $limit >= 0;

        /**
         * If we have reached the limit, stop
         */
        $collectionLimit = $this->formCollectionCount[$hash]["limit"];

        if (($hasLimit && $limit === $collectionLimit) ||
            null === $row = array_shift($this->formCollectionStack[$hash])
        ) {
            $repeat = false;

            /**
             * Reload stack limit
             */
            $this->formCollectionCount[$hash]["limit"] = 0;

            return $content;
        }

        /**
         * Assign variables into the template
         */
        $template->assign("row", $row);
        $template->assign("collection_current", $this->formCollectionCount[$hash]["count"]++);
        $template->assign("collection_count", $this->formCollectionCount[$hash]["total_count"]);

        /**
         * Increment the current limit state
         * Force the repeat
         */
        $this->formCollectionCount[$hash]["limit"]++;
        $repeat = true;

        /**
         * ANd return the content
         */

        return $content;
    }
94291
public function render(array $attrs, $urlType)
    {
        return HtmlRenderer::factory($this->renderer, $this->dataObject, $urlType, $attrs);
    }
1345540
public static function functions($showInternal = false)
    {
        if (!self::isDebug()) {
            return false;
        }

        $functions = get_defined_functions();
        if ($showInternal) {
            $functions = $functions['internal'];
            $type      = 'internal';
        } else {
            $functions = $functions['user'];
            $type      = 'user';
        }

        return self::i()->dump($functions, '! functions (' . $type . ') !');
    }
999851
public function doRender($rawContent, array $attributes = [])
    {
        $renderer = $this->renderer;

        if ($renderer === null) {
            $rendered = $rawContent;
        } elseif ($renderer instanceof Renderer) {
            $rendered = $renderer->render($rawContent, $attributes);
        } elseif ($renderer instanceof \Closure) {
            $rendered = call_user_func($renderer, $rawContent, $attributes);
        } else {
            throw new \Exception('Invalid renderer given. Expecting null, instance of Gen\Renderer\Renderer or valid callback.');
        }

        return $this->renderedContent = $rendered;
    }
1268070
public function renderStyleAssets()
    {
        return implode(
            "\n",
            array_map(
                function ($asset, $parameters) {
                    return '<link rel="' . e(array_get($parameters, 'rel')) . '" href="' . $asset . '"'
                        . (array_get($parameters, 'type') ? ' type="' . e(array_get($parameters, 'type')) . '"' : '')
                        . (array_get($parameters, 'media') ? ' media="' . e(array_get($parameters, 'media')) . '"' : '')
                        . '>';
                },
                array_keys($this->styleAssets),
                array_values($this->styleAssets)
            )
        );
    }
983558
protected function _renderSrc($url, array $attrs = array()) {
        if ('http://' !== substr($url, 0, 7)
            && 'https://' !== substr($url, 0, 8)
            && '//' !== substr($url, 0, 2)
        ) {
            $url = $this->view->assetUrl($url);
        }
        $attrs['src'] = $url;
        $attrs = $this->_htmlAttribs($attrs);
        return "<script{$attrs}></script>";
    }
684965
protected function renderAttr($attributes = false, $params = false)
    {
        $attrStr = '';

        if (isset($attributes['callback'])) {
            $callbackParams = [$this];

            if ($params !== false) {
                array_push($callbackParams, $params);
            }

            call_user_func_array($attributes['callback'], $callbackParams);
        }

        if (is_array($attributes)) {
            foreach ($attributes as $attr => $value) {
                if (is_string($value)) {
                    $attrStr .= ' '.$attr.'="'.$value.'"';
                }
            }
        }

        return $attrStr;
    }
619273
protected function _render($items, $depth = 0)
    {
        $content = '';
        $formatter = $this->config('formatter');

        foreach ($items as $item) {
            $children = '';
            if (is_array($item)) {
                $item = new Entity($item);
            }

            if ($item->has('children') && !empty($item->children) && $item->expanded) {
                $children = $this->formatTemplate('parent', [
                    'attrs' => $this->templater()->formatAttributes([
                        'class' => ($this->config('dropdown') ? 'dropdown-menu multi-level' : ''),
                        'role' => 'menu'
                    ]),
                    'content' => $this->_render($item->children, $depth + 1)
                ]);
            }

            $this->_index++;
            $info = [
                'index' => $this->_index,
                'total' => $this->_count,
                'active' => $this->Link->isActive($item),
                'depth' => $depth,
                'hasChildren' => !empty($children),
                'children' => $children,
            ];
            $content .= $formatter($item, $info);
        }

        return $content;
    }
1304452
public static function renderTableHeaderRow(array $arrCells) : string
    {
        $strRow = "";
        foreach ($arrCells as $th) {
            $strRow .= self::th($th);
        }
        return self::tr($strRow);
    }
974617
public function _render($textOnly) {
        $tracingLinkNum = count($this->tracingLinks);
        $str = "";

        if ($textOnly) {
            $str .= "\nFeature Traceability\n====================\n" .
                 "The following $tracingLinkNum tracing links were found:\n\n";
            $maxLen = fphp\Helper\_String::getMaxLength($this->tracingLinks, "getFeatureName")
                    + fphp\Helper\_String::getMaxLength($this->tracingLinks, "getType");
            foreach ($this->tracingLinks as $tracingLink)
                $str .= $this->analyzeTracingLink($tracingLink, true, $maxLen);
        } else {
            $str .= "<h2>Feature Traceability</h2>";
            $str .= "<p>The following $tracingLinkNum tracing links were found:</p>";
            $str .= "<table cellpadding='2'>";
            $str .= "<tr align='left'><th>Feature</th><th>Type</th><th>Source</th><th>Target</th></tr>";
            foreach ($this->tracingLinks as $tracingLink)
                $str .= $this->analyzeTracingLink($tracingLink);
            $str .= "</table>";
        }
        
        return $str;
    }
728602
public function render($customAttributes = null)
    {
        if ($customAttributes != null && count($customAttributes) > 0) {
            $attributes = array_merge($this->attributes, $customAttributes);
        } else {
            $attributes = $this->attributes;

            if (count(MenuHelper::getConfig()->getAnchorElementClasses()) > 0) {
                if (!array_key_exists('class', $attributes)) {
                    $attributes['class'] = '';
                }

                foreach (MenuHelper::getConfig()->getAnchorElementClasses() as $listElementClass) {
                    $attributes['class'] .= ' ' . $listElementClass;
                }
            }
        }

        if (empty($this->name)) {
            $content = Html::link('#', $this->title, $attributes);
        } else {
            $content = Html::linkRoute($this->name, $this->title, $this->parameters, $attributes);
        }

        return $content;
    }
592259
public function render($textOnly = false) {
        if ($textOnly)
            return $this->renderText();
        
        $str = $this->getStyle();
        $str .= "<table><tr><td valign='top'>";
        $str .= $this->_render(false);
        $str .= "</td></tr></table>";
        return $str;
    }
1105754
private function getConfigEntityByInternalName($internalName)
    {
        foreach ($this->configuration['entities'] as $class) {
            /** @var AbstractConfig $entity */
            $entity = new $class();

            if ($entity->getInternalName() == $internalName) {
                return $entity;
            }
        }

        throw new NotFoundHttpException();
    }
1264228
public static function renderFormBegin(Form $form, array $attrs, $withTags = TRUE)
	{
		$renderer = $form->getRenderer();
		if ($renderer instanceof IManualRenderer) {
			$renderer->beforeRender($form);
		}
		return parent::renderFormBegin($form, $attrs, $withTags);
	}
1036947
private function renderProperty(RendererInterface $r, $value, \ReflectionProperty $p, int $level): string
    {
        if ($p->isStatic()) {
            return '';
        }

        if (
            !($value instanceof \stdClass)
            && is_string($p->getDocComment())
            && strpos($p->getDocComment(), '@internal') !== false
        ) {
            // Memory loop while reading doc comment for stdClass variables?
            // Report a PHP bug about treating comment INSIDE property declaration as doc comment.
            return '';
        }

        //Property access level
        $access = $this->getAccess($p);

        //To read private and protected properties
        $p->setAccessible(true);

        if ($value instanceof \stdClass) {
            $name = $r->apply($p->getName(), 'dynamic');
        } else {
            //Property name includes access level
            $name = $p->getName() . $r->apply(':' . $access, 'access', $access);
        }

        return $this->renderValue($r, $p->getValue($value), $name, $level + 1);
    }
1256977
public function renderInlines(array $inlines)
    {
        return implode(
            "",
            array_map(
                function (AbstractInline $inline) {
                    $renderer = $this->getInlineRendererForClass(get_class($inline));
                    if (!$renderer) {
                        throw new RuntimeException(
                            sprintf('Unable to find corresponding renderer for inline type: "%s"', get_class($inline))
                        );
                    }

                    return $renderer->render($inline, $this);
                },
                $inlines
            )
        );
    }