Reputation: 1398
I am new to Zend Framework. I have a page that is:
http://localhost/demo/public/index/index/catid/art
I want to change that into
http://localhost/demo/public/art
I have no idea how to do it.
Also, why does it put index
twice? Even my pagination has it, like:
http://localhost/demo/public/index/index/page/2
In my opinion is a little bit annoying. I would like the pagination to be
http://localhost/demo/public/page/2
Is there a way to do that? Thanks!
Upvotes: 1
Views: 312
Reputation: 53126
The default route works by using:
/module/controller/action
So if you have a module called "default", and your controller called "index", and an action called "index", then the most verbose way to refer to that specific action would be:
/module/controller/action
In order to set up a route you would use:
$route = new Zend_Controller_Router_Route(
'page/:page',
array(
'module' => 'default'
'controller' => 'index',
'action' => 'index'
),
array(
'page' => '\d+'
)
);
You could then get the page param in your controller using
$this->getRequest->getParam("page");
Upvotes: 2