0 follower

Interface Yiisoft\Yii\View\Renderer\LinkTagsInjectionInterface

LinkTagsInjectionInterface is an interface that must be implemented by classes to inject link tags.

Public Methods

Hide inherited methods

Method Description Defined By
getLinkTags() Returns array of link tags for register via {@see WebView::registerLinkTag()}. Yiisoft\Yii\View\Renderer\LinkTagsInjectionInterface

Method Details

Hide inherited methods

getLinkTags() public abstract method

Returns array of link tags for register via {@see WebView::registerLinkTag()}.

Optionally:

  • use array format and set the position in a page via __position.
  • use string keys of array as identifies the link tag.

For example:

[
    Html::link()->toCssFile('/main.css'),
    'favicon' => Html::link('/myicon.png', [
        'rel' => 'icon',
        'type' => 'image/png',
    ]),
    'themeCss' => [
        '__position' => \Yiisoft\View\WebView::POSITION_END,
        Html::link()->toCssFile('/theme.css'),
    ],
    'userCss' => [
        '__position' => \Yiisoft\View\WebView::POSITION_BEGIN,
        'rel' => 'stylesheet',
        'href' => '/user.css',
    ],
    ...
]
public abstract array getLinkTags ( )

                public function getLinkTags(): array;