Interface Yiisoft\Yii\View\Renderer\LinkTagsInjectionInterface
LinkTagsInjectionInterface is an interface that must be implemented by classes to inject link tags.
Psalm Types
| Name | Value |
|---|---|
| LinkTagAsArray | array{__position?: integer}&array<string, mixed> |
| LinkTagsConfig | array<array-key, \Yiisoft\Html\Tag\Link|\Yiisoft\Yii\View\Renderer\LinkTagAsArray|array{__position?: integer, 0: \Yiisoft\Html\Tag\Link}> |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getLinkTags() | Returns array of link tags for register via {@see \Yiisoft\View\WebView::registerLinkTag()}. | Yiisoft\Yii\View\Renderer\LinkTagsInjectionInterface |
Method Details
Returns array of link tags for register via {@see \Yiisoft\View\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;
Signup or Login in order to comment.