I currently have url like localhost/zend_practice/countries/index?data=1 where countries is the name of my controller and index is name of my action.
I would like to have url like localhost/zend_practice/countries/index/data/1.
Also a rule to accept numbers only for the get parameter ‘data’.
How can i do this for ‘countries’ controller only (not for my other controller)?
I currently have url like localhost/zend_practice/countries/index?data=1 where countries is the name of my controller
Share
Zend Framework by default takes url as
You can directly use your url as
and in the code you can get the data parameter and apply your logic as required.
Here’s a snippet.