生成节点链接

@param string|array $item
@return string the rendering result.
500316
protected function renderItemLink($item)
    {
        $url = ArrayHelper::getValue($item, 'url', '#');
        $linkOptions = ArrayHelper::getValue($item, 'linkOptions', []);
        $encodeLabel = ArrayHelper::getValue($item, 'encode', $this->encodeLabels);
        $label = $encodeLabel ? Html::encode($item['label']) : $item['label'];
        $items = ArrayHelper::getValue($item, 'items');

        $bTagHtml = '';
        if ($items !== null) {
            $bTagIcon = Html::tag('i','',['class'=>'fa fa-angle-left pull-right']);
            $bTagHtml = Html::tag('span', $bTagIcon, $this->defaultDropDownBTagOptions);

        }

        $iconHtml = $this->renderItemIcon($item);
        $label = Html::tag('span', $label, ['class' => 'menu-text']);
        return Html::a($iconHtml . $label . $bTagHtml, $url, $linkOptions);

    }
829940
private function renderItem($item)
    {
        $this->response = $this->response->withBody(stream_for($this->getRenderedItem($item)));
    }
966024
public function itemCreate(Item $item)
    {
        $response = $this->getGuzzleClient()
            ->post(
                '/items',
                array_merge($this->setQuery(), $this->setBody($item))
            );

        return $this->serializer->deserialize(
            $response->getBody()->getContents(),
            Item::class,
            'json'
        );
    }
1163608
public function renderItem($item)
    {
        $options = ArrayHelper::getValue($item, 'options', array());
        if (isset($item['featured'])) {
            Html::addCssClass($this->htmlOptions, Enum::ClEARING_FEATURE);
            Html::addCssClass($options, Enum::CLEARING_FEATURE_IMG);
        }
        $imgOptions                 = array();
        $imgOptions['src']          = ArrayHelper::getValue($item, 'th', '#');
        $imgOptions['data-caption'] = ArrayHelper::getValue($item, 'caption', null);
        $imgOptions['class']        = 'th';
        $url                        = ArrayHelper::getValue($item, 'img', '#');

        return \CHtml::tag('li', $options, \CHtml::link(\CHtml::tag('img', $imgOptions), $url));

    }
650598
protected function renderItem($item)
	{
		if (isset($item['url'])) {
			if($this->useSprites) {
				$spriteUrl = $this->spriteUrl;
				$item['template'] = "<a href=\"{url}\" style=\"background: no-repeat 0 {$this->itemOffset}px url($spriteUrl);\">{label}</a>";
				$this->itemOffset -= 16;
			} else {
				$components = parse_url($item['url']);
				$iconUrl = $this->iconizerBaseUrl . $components['host'];
				$item['template'] = "<a href=\"{url}\" style=\"background: no-repeat url($iconUrl)\">{label}</a>";
			}
		}
		return parent::renderItem($item);
	}
415939
protected function renderItem($item)
    {
        if (is_string($item)) {
            return $item;
        }
        if (!isset($item['label'])) {
            throw new InvalidConfigException("The 'label' option is required.");
        }
        $encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
        $label = $encodeLabel ? Html::encode($item['label']) : $item['label'];
        $listItemOptions = ArrayHelper::getValue($item, 'options', []);
        $items = ArrayHelper::getValue($item, 'items');
        $url = ArrayHelper::getValue($item, 'url', '#');
        $linkOptions = ArrayHelper::getValue($item, 'linkOptions', []);

        if (isset($item['active'])) {
            $active = ArrayHelper::remove($item, 'active', false);
        } else {
            $active = $this->isItemActive($item);
        }

        if (empty($items)) {
            $content = Html::a($label, $url, $linkOptions);
        } else {
            Html::addCssClass($listItemOptions, ['widget' => 'submenu']);
            Html::addCssClass($linkOptions, ['widget' => 'submenu-opener']);
            if ($this->dropDownCaret !== '') {
                $label .= ' ' . $this->dropDownCaret;
            }
            if (is_array($items)) {
                if ($this->activateItems) {
                    $items = $this->isChildActive($items, $active);
                }
                $items = $this->renderCollapsible(Html::a($label, $url, $linkOptions), $items, $active);
            }
            $content = $items;
        }


        if ($this->activateItems && $active) {
            Html::addCssClass($listItemOptions, 'active');
        }

        return Html::tag('li', $content, $listItemOptions);
    }
1023072
protected function renderItem($item) {
        $linkTemplate = empty($item['items']) ? $this->linkTemplate : $this->itemSubmenuLinkTemplate;
        $labelTemplate = empty($item['items']) ? $this->labelTemplate : $this->itemSubmenuLabelTemplate;

        if (isset($item['url'])) {
            $template = ArrayHelper::getValue($item, 'template', $linkTemplate);

            $params = [
                '{url}' => Html::encode(Url::to($item['url'])),
                '{label}' => $item['label'],
                '{icon}' => isset($item['icon']) ? "<i class='{$item['icon']}'></i>" : '',
            ];

            return strtr($template, $params);
        } else {
            $template = ArrayHelper::getValue($item, 'template', $labelTemplate);

            return strtr($template, [
                '{label}' => $item['label'],
                '{icon}' => isset($item['icon']) ? "<i class='{$item['icon']}'></i>" : '',
            ]);
        }
    }
857729
protected static function createItem(array $item)
    {
        $microformatItem = ['type' => self::createTypes($item['type']), 'lang' => null];
        self::processProperties($item, $microformatItem);
        self::processValue($item, $microformatItem);
        self::processChildren($item, $microformatItem);

        return (object)$microformatItem;
    }
212161
public function render(Renderable $item)
    {
        $output = '';
        $nl = '';
        $group = $item->group();

        if ($item instanceof AssetContract) {
            return $this->renderAsset($item, $group);
        }

        foreach ($item as $asset) {
            $output .= $nl.$this->renderAsset($asset, $group);
            $nl = "\n";
        }

        return $output;
    }
427484
protected function renderItemIcon($item)
    {
        $iconClass = ArrayHelper::getValue($item, 'icon');
        if ($iconClass !== null) {
            $class = [$this->iconClass];
            Html::addCssClass($class, $iconClass);
            return Html::tag('i', '', ['class' => $class]);
        } else {
            return '';
        }
    }
37435
private function transform(array $item)
    {
        $value = static::jsonDeArmor($item['value']);

        if ($item['type'] === 'object' || $item['type'] === 'array') {
            return unserialize($value);
        }

        settype($value, $item['type']);

        return $value;
    }
1360284
public function renderItem($item)
    {
        $sectionItem   = array();
        $sectionItem[] = \CHtml::tag(
            'p',
            array('class' => 'title', 'data-section-title' => 'data-section-title'),
            \CHtml::link(ArrayHelper::getValue($item, 'label', 'Section Title'), '#')
        );
        $options       = ArrayHelper::getValue($item, 'options', array());
        Html::addCssClass($options, 'content');
        ArrayHelper::addValue('data-section-content', 'data-section-content', $options);
        $sectionOptions = array();
        if (ArrayHelper::getValue($item, 'active')) {
            ArrayHelper::addValue('class', 'active', $sectionOptions);
        }
        $sectionItem[] = \CHtml::tag('div', $options, ArrayHelper::getValue($item, 'content', 'Section Content'));
        return \CHtml::tag('section', $sectionOptions, implode("\n", $sectionItem));
    }
326989
protected function parseTemplate(array $item) {
        /**
         * Check if a title has been assigned to the element
         */
        if (isset($item['title'])) {
            $this->htmlOptions['linkOptions']['title'] = $item['title'];
        }
        /**
         * Parse the template
         */
        $replace = Html::a(Html::img($item['src'], $this->htmlOptions['thumbnailOptions']), $item['href'], $this->htmlOptions['linkOptions']);
        $template = str_replace('{item}', $replace, $this->template);
        return $template;
    }
785646
public function getAdminObjectTargetUrl($item)
    {
        if ($item->getTargetId()) {
            /** @var AbstractAdmin $admin */
            $admin = $this->getContainer()->get('sonata.admin.pool')->getAdminByClass($item->getClass());

            return $admin->generateObjectUrl('edit', $admin->getObject($item->getTargetId()));
        }

        return '';
    }
295632
protected function renderItem($item, $depth=0)
	{
		//visibility
		if (isset($item['visible']) && $item['visible'] === false) return '';

		//prepare options
		$options = isset($item['options']) ? $item['options'] : [];
		Html::addCssClass($options, 'depth-' . $depth);
		if (isset($item['active']) && $item['active']) Html::addCssClass($options, 'active');
		if (isset($item['items']) && count($item['items']) > 0) Html::addCssClass($options, 'is-parent');

		//prepare returned code
		$ret = Html::beginTag('li', $options);
		$ret .= $this->createEntry($item, $depth);

		//render children recursively
		if (isset($item['items']) && ($this->maxDepth === null || ($this->maxDepth !== null && $depth + 1 <= $this->maxDepth))) {
			$ret .= Html::beginTag('ul');
			foreach ($item['items'] as $subItem) {
				$ret .= $this->renderItem($subItem, $depth + 1);
			}
			$ret .= Html::endTag('ul');
		}

		//finish and return
		$ret .= Html::endTag('li');
		return $ret;
	}
1260855
private function pushStream($item) : string
    {
        $id = uniqid(__FUNCTION__ . mt_rand(), true) . '_';
        $this->streams[$id] = $item; // push

        return $id;
    }
426143
public static function point(array $item): string
    {
        if (empty($item['file'])) {
            $result = '[internal function]';
        } else {
            $result = $item['file'];
            if (!empty($item['line'])) {
                $result .= '('.$item['line'].')';
            }
        }
        return $result;
    }