0 follower

Final Class Yiisoft\Widget\WidgetFactoryInitializationException

InheritanceYiisoft\Widget\WidgetFactoryInitializationException » RuntimeException
ImplementsYiisoft\FriendlyException\FriendlyExceptionInterface
Deprecated since version Will be removed in version 3.0.

Method Details

Hide inherited methods

getName() public method

public string getName ( )

                public function getName(): string
{
    return 'Failed to create a widget because WidgetFactory is not initialized.';
}

            
getSolution() public method

public string|null getSolution ( )

                public function getSolution(): ?string
{
    return <<<'SOLUTION'
nitialize the widget factory call `WidgetFactory::initialize()` before using the widget.
s a good idea to do that for the whole application.
ple:
hp
var Psr\Container\ContainerInterface $container
oft\Widget\WidgetFactory::initialize(
container: $container,
definitions: [MyWidget::class => new MyWidget(/*...*/)],
themes: [
    'custom' => [
        MyWidget::class => [
            'setValue()' => [42],
        ],
    ],
],
validate: true, // Whether definitions need to be validated.
Yii example in the configuration file of this package `config/bootstrap.php`.
TION;
}