0 follower

Final Class Yiisoft\Yii\View\Renderer\Exception\InvalidMetaTagException

InheritanceYiisoft\Yii\View\Renderer\Exception\InvalidMetaTagException » RuntimeException
ImplementsYiisoft\FriendlyException\FriendlyExceptionInterface

InvalidMetaTagException is thrown if the meta tag is incorrectly configured during the injection.

Method Details

Hide inherited methods

__construct() public method

public __construct( string $message, mixed $tag ): mixed
$message string
$tag mixed

                public function __construct(
    string $message,
    private readonly mixed $tag,
) {
    parent::__construct($message);
}

            
getName() public method

public getName( ): string

                public function getName(): string
{
    return 'Invalid meta tag configuration in injection';
}

            
getSolution() public method

public getSolution( ): string|null

                public function getSolution(): ?string
{
    return 'Got meta tag:' . "\n" . var_export($this->tag, true) . <<<SOLUTION
njection that implements `Yiisoft\Yii\View\Renderer\MetaTagsInjectionInterface` defined meta tags in the method `getMetaTags()`.
meta tag can be define in the following ways:
 array of attributes: `['name' => 'keywords', 'content' => 'yii,framework']`,
 instance of `Yiisoft\Html\Tag\Meta`:
hp
::meta()
->name('keywords')
->content('yii,framework');
onally, you may use string keys of array as identifies the meta tag.
ple:
hp
ic function getMetaTags(): array
return [
    'seo-keywords' => [
        'name' => 'keywords',
        'content' => 'yii,framework',
    ],
    Html::meta()
        ->name('description')
        ->content('Yii is a fast, secure, and efficient PHP framework.'),
];
TION;
}