Zend\MVC - Routing

9 important questions on Zend\MVC - Routing

Does a zend framework 2 application contain a router?

No, every route can match and assemble routes themselves

What two components do the work of a router?

Zend\Mvc\Router\SimpleRouteStack and Zend\Mvc\Router\Http\TreeRouteStack

What are the three methods in the RouteInterface?

1. factory($options = array())
2. match(Request $request)
3. assemble(array $params = array(), array $options = array());
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

What does a Route return when a match is found?

A Zend\Mvc\Router\RouteMatch object

What are the main methods of a RouteMatch?

1. setMatchedRouteName($name)
2. getMatchedRouteName()
3. setParam($name, $value)
4. getParams()
5. getParam($name, $default = null)

What interface support having multiple routes to test against?

Zend\Mvc\Router\RouteStackInterface

What are the main methods of Zend\Mvc\Router\RouteStackInterface?

1. addRoute($name, $route, $priority = null)
2. addRoutes(array $routes)
3. removeRoute($name)
4. setRoutes(array $routes)

Are routes queried in FIFO or LIFO order?

LIFO order

What algorithm is used by Zend\Mvc\Router\Http\TreeRouteStack to match routes?

B-Tree

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo