Note: reverse match.
Routes are matched in reverse order, so be sure to identify your most common routes first.
(Zend_Controller_Router)
, , :
$user = new Zend_Controller_Router_Route_Hostname(
':subdomain.site.com',
array(
'controller' => 'user'
)
);
$location1 = new Zend_Controller_Router_Route_Hostname(
'c.site.com',
array(
'controller' => 'location'
)
);
$location1 = new Zend_Controller_Router_Route_Hostname(
'd.site.com',
array(
'controller' => 'location'
)
);
$router->addRoute($user);
$router->addRoute($location1);
$router->addRoute($location2);
:
1) , . . , . ($request->getParam("subdomain")). , /, :subdomain :action. / , , ( ). , , :
$user = new Zend_Controller_Router_Route_Hostname(
':param1.site.com',
array(
'controller' => 'user'
)
);
- , .
2) , . , , :a/:b. :
$user->chain(new Zend_Controller_Router_Route(':a/:b'));