• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FluidTYPO3 / vhs / 30001290505

23 Jul 2026 10:57AM UTC coverage: 70.309% (-1.7%) from 72.022%
30001290505

push

github

NamelessCoder
[TER] 8.0.0

4819 of 6854 relevant lines covered (70.31%)

6.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.0
/Classes/ViewHelpers/Page/Header/LinkViewHelper.php
1
<?php
2
namespace FluidTYPO3\Vhs\ViewHelpers\Page\Header;
3

4
/*
5
 * This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE.md file that was distributed with this source code.
9
 */
10

11
use FluidTYPO3\Vhs\Traits\PageRendererTrait;
12
use FluidTYPO3\Vhs\Traits\TagViewHelperTrait;
13
use FluidTYPO3\Vhs\Utility\ContextUtility;
14
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
15

16
/**
17
 * ViewHelper used to render a link tag in the `<head>` section of the page.
18
 * If you use the ViewHelper in a plugin, the plugin and its action have to
19
 * be cached!
20
 */
21
class LinkViewHelper extends AbstractTagBasedViewHelper
22
{
23
    use TagViewHelperTrait;
24
    use PageRendererTrait;
25

26
    /**
27
     * @var string
28
     */
29
    protected $tagName = 'link';
30

31
    public function initializeArguments(): void
32
    {
33
        parent::initializeArguments();
3✔
34
        $this->registerTagAttribute('rel', 'string', 'Property: rel');
3✔
35
        $this->registerTagAttribute('href', 'string', 'Property: href');
3✔
36
        $this->registerTagAttribute('type', 'string', 'Property: type');
3✔
37
        $this->registerTagAttribute('lang', 'string', 'Property: lang');
3✔
38
        $this->registerTagAttribute('dir', 'string', 'Property: dir');
3✔
39
    }
40

41
    public function render(): string
42
    {
43
        if (ContextUtility::isBackend()) {
×
44
            return '';
×
45
        }
46
        static::getPageRenderer()->addHeaderData($this->renderTag($this->tagName));
×
47
        return '';
×
48
    }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc