Zend\Navigation\Page\AbstractPage::factory
Factory for Zend\Navigation\Page classes
A specific type to construct can be specified by specifying the key 'type' in $options. If type is 'uri' or 'mvc', the type will be resolved to Zend\Navigation\Page\Uri or Zend\Navigation\Page\Mvc. Any other value for 'type' will be considered the full name of the class to construct. A valid custom page class must extend Zend\Navigation\Page\AbstractPage. If 'type' is not given, the type of page to construct will be determined by the following rules: - If $options contains either of the keys 'action', 'controller', or 'route', a Zend\Navigation\Page\Mvc page will be created. - If $options contains the key 'uri', a Zend\Navigation\Page\Uri page will be created.
Signature
public function factory(array|Traversable
$options )
Parameters
$options
— object- options used for creating page
Returns
- AbstractPage
- a page instance
Errors/Exceptions
-
InvalidArgumentException
- if $options is not
-
InvalidArgumentException
- if 'type' is specified
-
InvalidArgumentException
- if something goes wrong
-
InvalidArgumentException
- if 'type' is given, and
-
InvalidArgumentException
- if unable to determine