I have a search action in Zend Framework.
And code is:
function searchAction()
{
$keyword = $this->getRequest()->getParam('keyword');
if( !empty($keyword) )
{
//@todo here
}
}
I use the url like below to post keyword to the action:
/index/search/keyword/google
With:
- index: controller
- search: action
- keyword & google: a pair of param and value.
Everything is OK until the user searches the keyword with value is “/” character
/index/search/keyword//
=>: getParam(‘keyword’) is empty
I have tried to use %2F (which is encoded of “/”)
/index/search/keyword/%2F
=>: 404 Error
How can I fix this issue?
You can try to add route in your bootstrap.php
after that you can work with variable keyword in controller: