FluidTYPO3\Vhs\Traits\TagViewHelperTrait::renderChildTag PHP Метод

renderChildTag() защищенный Метод

Renders the provided tag and optionally appends or prepends it to the main tag's content depending on 'mode' which can be one of 'none', 'append' or 'prepend'
protected renderChildTag ( string $tagName, array $attributes = [], boolean $forceClosingTag = false, string $mode = 'none' ) : string
$tagName string
$attributes array
$forceClosingTag boolean
$mode string
Результат string
    protected function renderChildTag($tagName, $attributes = [], $forceClosingTag = false, $mode = 'none')
    {
        $tagBuilder = clone $this->tag;
        $tagBuilder->reset();
        $tagBuilder->setTagName($tagName);
        $tagBuilder->addAttributes($attributes);
        $tagBuilder->forceClosingTag($forceClosingTag);
        $childTag = $tagBuilder->render();
        if ('append' === $mode || 'prepend' === $mode) {
            $content = $this->tag->getContent();
            if ('append' === $mode) {
                $content = $content . $childTag;
            } else {
                $content = $childTag . $content;
            }
            $this->tag->setContent($content);
        }
        return $childTag;
    }