1354. Class

1354.1. Zend\Navigation\Page\Mvc

Represents a page that is defined using controller, action, route name and route params to assemble the href

1354.1.1. Methods

1354.1.1.1. isActive

isActive()

Returns whether page should be considered active or not

This method will compare the page properties against the route matches composed in the object.

Parameters:bool – [optional] whether page should be considered active if any child pages are active. Default is false.
Return type:bool whether page should be considered active or not

1354.1.1.2. getHref

getHref()

Returns href for this page

This method uses {@link RouteStackInterface} to assemble the href based on the page’s properties.

Return type:string page href
Throws :ExceptionDomainException if no router is set

1354.1.1.3. setAction

setAction()

Sets action name to use when assembling URL

Parameters:string – action name
Return type:Mvc fluent interface, returns self
Throws :ExceptionInvalidArgumentException if invalid $action is given

1354.1.1.4. getAction

getAction()

Returns action name to use when assembling URL

Return type:string|null action name

1354.1.1.5. setController

setController()

Sets controller name to use when assembling URL

Parameters:string|null – controller name
Return type:Mvc fluent interface, returns self
Throws :ExceptionInvalidArgumentException if invalid controller name is given

1354.1.1.6. getController

getController()

Returns controller name to use when assembling URL

Return type:string|null controller name or null

1354.1.1.7. setParams

setParams()

Sets params to use when assembling URL

Parameters:array|null – [optional] page params. Default is null which sets no params.
Return type:Mvc fluent interface, returns self

1354.1.1.8. getParams

getParams()

Returns params to use when assembling URL

Return type:array page params

1354.1.1.9. setRoute

setRoute()

Sets route name to use when assembling URL

Parameters:string – route name to use when assembling URL
Return type:Mvc fluent interface, returns self
Throws :ExceptionInvalidArgumentException if invalid $route is given

1354.1.1.10. getRoute

getRoute()

Returns route name to use when assembling URL

Return type:string route name

1354.1.1.11. getRouteMatch

getRouteMatch()

Get the route match.

Return type:ZendMvcRouterRouteMatch

1354.1.1.12. setRouteMatch

setRouteMatch()

Set route match object from which parameters will be retrieved

Parameters:RouteMatch
Return type:Mvc fluent interface, returns self

1354.1.1.13. getRouter

getRouter()

Get the router.

Return type:null|RouteStackInterface

1354.1.1.14. setRouter

setRouter()

Sets router for assembling URLs

Parameters:RouteStackInterface – Router
Return type:Mvc fluent interface, returns self

1354.1.1.15. setDefaultRouter

setDefaultRouter()

Sets the default router for assembling URLs.

Parameters:RouteStackInterface – Router
Return type:void

1354.1.1.16. getDefaultRouter

getDefaultRouter()

Gets the default router for assembling URLs.

Return type:RouteStackInterface

1354.1.1.17. toArray

toArray()

Returns an array representation of the page

Return type:array associative array containing all page properties