I am working on a project in cakephp.For the view part,I have the following snippet of code
echo $form->create("generals",array('action' => 'search'));
echo $form->input("q", array('label' => 'Search for'));
echo $form->end("Search");
If I am not wrong,term entered in the textbox is represented by q. how do I catch this term and use it in my search method in the generals controller.
Please let me know your views on it.
If you are in Cake 1.x, your data should be available in the array
$this->data… if you’re in Cake 2.x, you can access it through$this->request-data…If you
debugorprint_rorvar_dumpthe array, you’ll see the structure …For 1.x see http://book.cakephp.org/1.3/en/view/1031/Saving-Your-Data
For 2.x see http://book.cakephp.org/2.0/en/models/saving-your-data.html