Final Class Yiisoft\Yii\View\Renderer\Exception\InvalidLinkTagException
| Inheritance | Yiisoft\Yii\View\Renderer\Exception\InvalidLinkTagException » RuntimeException |
|---|---|
| Implements | Yiisoft\FriendlyException\FriendlyExceptionInterface |
InvalidLinkTagException is thrown if the link tag is incorrectly configured during the injection.
Public Methods
Method Details
| public mixed __construct ( string $message, mixed $tag ) | ||
| $message | string | |
| $tag | mixed | |
public function __construct(
string $message,
private readonly mixed $tag,
) {
parent::__construct($message);
}
| public string getName ( ) |
public function getName(): string
{
return 'Invalid link tag configuration in injection';
}
| public string|null getSolution ( ) |
public function getSolution(): ?string
{
return 'Got link tag:' . "\n" . var_export($this->tag, true) . <<<SOLUTION
njection that implements `Yiisoft\Yii\View\Renderer\LinkTagsInjectionInterface` defined link tags in the method `getLinkTags()`.
link tag can be define in the following ways:
array of attributes: `['rel' => 'stylesheet', 'href' => '/user.css']`,
instance of `Yiisoft\Html\Tag\Link`: `Html::link()->toCssFile('/main.css')`.
onally:
se array format and set the position in a page via `__position`.
se string keys of array as identifies the link tag.
ple:
hp
ic function getLinkTags(): array
urn [
avicon' => Html::link('/myicon.png', [
rel' => 'icon',
type' => 'image/png',
,
hemeCss' => [
__position' => \Yiisoft\View\WebView::POSITION_END,
tml::link()->toCssFile('/theme.css'),
serCss' => [
__position' => \Yiisoft\View\WebView::POSITION_BEGIN,
rel' => 'stylesheet',
href' => '/user.css',
TION;
}
Signup or Login in order to comment.