PHP 클래스 Zend\Mvc\Controller\LazyControllerAbstractFactory
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:
- A parameter named
$config typehinted as an array will receive the
application "config" service (i.e., the merged configuration).
- Parameters type-hinted against array, but not named
$config will
be injected with an empty array.
- Scalar parameters will be resolved as null values.
- If a service cannot be found for a given typehint, the factory will
raise an exception detailing this.
- Some services provided by Zend Framework components do not have
entries based on their class name (for historical reasons); the
factory contains a map of these class/interface names to the
corresponding service name to allow them to resolve.
$options passed to the factory are ignored in all cases, as we cannot
make assumptions about which argument(s) they might replace.
파일 보기
프로젝트 열기: zendframework/zend-mvc
보호된 프로퍼티들
프로퍼티 |
타입 |
설명 |
|
$aliases |
string[] |
Extend the class if you wish to add to the list. |
|
공개 메소드들
메소드 |
설명 |
|
__invoke ( Interop\Container\ContainerInterface $container, $requestedName, array $options = null ) : Zend\Stdlib\DispatchableInterface |
{@inheritDoc} |
|
canCreate ( Interop\Container\ContainerInterface $container, $requestedName ) |
{@inheritDoc} |
|
비공개 메소드들
메소드 상세
public __invoke ( Interop\Container\ContainerInterface $container, $requestedName, array $options = null ) : Zend\Stdlib\DispatchableInterface |
$container |
Interop\Container\ContainerInterface |
|
$options |
array |
|
리턴 |
Zend\Stdlib\DispatchableInterface |
|
public canCreate ( Interop\Container\ContainerInterface $container, $requestedName ) |
$container |
Interop\Container\ContainerInterface |
|
프로퍼티 상세
Extend the class if you wish to add to the list.
protected string[] $aliases |
리턴 |
string[] |
|