I need help in URL rewrite in zend framework. If I print below URL :
echo $this->url(array('controller'=>'guestbook','action'=>'edit','id'=>$entry->id), null, TRUE);
It will generate url like : http://localhost/guestbook/public/index.php/guestbook/edit/id/1
But How can I generate url like : http://localhost/guestbook/public/index.php/guestbook/edit/1 in zend framework?
I don't want 'id' in URL. Please Help.
Zend Controller Router will help you achive this .
The easyest way to get started would be at bootstrap add the following ( not realy tested but it should work with minimal debuging, see the link provided as it explains a ton more, use this code just to get started on understanding how routes work ) :
To make it work you need to define a custom route, called e.g. guestbook, and make url helper to use it for your particular url.
For example, in your application.ini you can define it as follows:
Then, you use the url helper in the following way:
Hope that helps.