Zend Framework
3.0
|
Factory for instantiating form elements. More...
Public Member Functions | |
__construct ($creationOptions=null) | |
__invoke (ContainerInterface $container, $requestedName, array $options=null) | |
Create an instance of the requested class name. | |
createService (ServiceLocatorInterface $serviceLocator, $canonicalName=null, $requestedName=null) | |
Create an instance of the named service. | |
setCreationOptions (array $creationOptions) | |
{} | |
Public Member Functions inherited from FactoryInterface | |
createService (ServiceLocatorInterface $serviceLocator) | |
Create service. | |
Factory for instantiating form elements.
__construct | ( | $creationOptions = null | ) |
null | array | Traversable | $creationOptions |
InvalidServiceException | if $creationOptions cannot be coerced to an array. |
__invoke | ( | ContainerInterface | $container, |
$requestedName, | |||
array | $options = null |
||
) |
Create an instance of the requested class name.
ContainerInterface | $container | |
string | $requestedName | |
null | array | $options |
Implements FactoryInterface.
createService | ( | ServiceLocatorInterface | $serviceLocator, |
$canonicalName = null , |
|||
$requestedName = null |
|||
) |
Create an instance of the named service.
First, it checks if `$canonicalName` resolves to a class, and, if so, uses that value to proxy to `__invoke()`.
Next, if `$requestedName` is non-empty and resolves to a class, this method uses that value to proxy to `__invoke()`.
Finally, if the above each fail, it raises an exception.
The approach above is performed as version 2 has two distinct behaviors under which factories are invoked:
ServiceLocatorInterface | $serviceLocator | |
null | string | $canonicalName | |
null | string | $requestedName |
InvalidServiceException |
setCreationOptions | ( | array | $creationOptions | ) |
{}