I am building a website with Zend Framework but I’m very new at it and still don’t really get it.
I have a URL like:
http://localhost/public/directory/category/catid/art
What I want is to create a route for the URLto look like:
http://localhost/public/directory/category/art
I have done simple routes like:
$frontController = Zend_Controller_Front::getInstance();
$router = $frontController->getRouter();
// TERMNS ROUTE
$route = new Zend_Controller_Router_Route_Static(
'termns',
array('controller' => 'Index', 'action' => 'termns')
);
$router->addRoute('terms', $route);
Is there a way, building on that for me to control the other routes? Thanks!
From
category/catid/arttocategory/art.Add this method to your Bootstrap.php:
And in controller’s action for
category/testidyou can use$this->_getParam('catid')for gettingtestid.