At the moment I have a basic search form set up and working. This is in my view:
<form action="/search" method="get" id="search">
<input type="text" name="q" placeholder="Enter search terms..."><input type="submit" value="Search">
</form>
And my action simply executes the following:
$this->set('recipes', $this->paginate(array(
'Recipe.name LIKE' => '%' . $this->request->query('q') . '%'
)));
This results in URLs like http://mysite.com/search?q=querystring
. While this is all well and good, I'd like to have the URL as something along the lines of http://mysite.com/search/querystring
.
Is there a way to achieve this which doesn't involve redirecting the user after they submit the form? If that's the only way I'd rather stick with using the $_GET
parameter.