Class ElementFactory

Summary

Fully Qualified Name: Laminas\Form\ElementFactory
Implements: FactoryInterface

Description

Factory for instantiating form elements

Methods

Name Description Defined By
__construct() ElementFactory
__invoke() Create an instance of the requested class name. ElementFactory
createService() Create an instance of the named service. ElementFactory
setCreationOptions() {@inheritdoc} ElementFactory

Method Details

__construct()

Parameter Name Type Description
$creationOptions null|array|\Traversable

Returns:

__invoke()

Create an instance of the requested class name.

Parameter Name Type Description
$container \ContainerInterface
$requestedName string
$options null|array

Returns: object

createService()

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:

Parameter Name Type Description
$serviceLocator \ServiceLocatorInterface
$canonicalName null|string
$requestedName null|string

Returns: object

setCreationOptions()

{@inheritdoc}

Parameter Name Type Description
$creationOptions

Returns:

Top