Fully Qualified Name: | Zend\Mvc\Controller\LazyControllerAbstractFactory |
Implements: | AbstractFactoryInterface |
Reflection-based factory for controllers.
To ease development, this factory may be used for controllers with type-hinted arguments that resolve to services in the application container; this allows omitting the step of writing a factory for each controller.
You may use it as either an abstract factory:
'controllers' => [
'abstract_factories' => [
LazyControllerAbstractFactory::class,
],
],
Or as a factory, mapping a controller class name to it:
'controllers' => [
'factories' => [
MyControllerWithDependencies::class => LazyControllerAbstractFactory::class,
],
],
The latter approach is more explicit, and also more performant.
The factory has the following constraints/features:
$config
typehinted as an array will receive the
application "config" service (i.e., the merged configuration).$config
will
be injected with an empty array.$options
passed to the factory are ignored in all cases, as we cannot
make assumptions about which argument(s) they might replace.
Name | Description | Defined By |
---|---|---|
__invoke() | {@inheritDoc} | LazyControllerAbstractFactory |
canCreate() | {@inheritDoc} | LazyControllerAbstractFactory |
{@inheritDoc}
Parameter Name | Type | Description |
---|---|---|
$container | ||
$requestedName | ||
$options |
Returns: \DispatchableInterface
{@inheritDoc}
Parameter Name | Type | Description |
---|---|---|
$container | ||
$requestedName |
Returns: