Cakephp how to create a simple search form
-
I need some help to create a simple search form with one input box. It needs to be able to send a value to a controller in the url like so: http://mysite.co.uk/properties/results?search=northampton I would like to use the cakePHP form helper, but can you include an input that doesnt relate to a column in the database?
-
Answer:
have since found the answer to this: ///in the view:/// <div class="container"> <a href='#'><div class="search-tab active_search_tab">Property Search</div></a> <div class="col-md-12 purple search_box"> <?php echo $this->Form->create('Properties', array('type' => 'get')); echo $this->Form->input('search', array('between'=>'<label for="search" class="main_search">Search</label><br>','label'=>false)); echo $this->Form->button('Search', array('class'=>'btn btn-success')); echo $this->Form->end ?> </div> </div> //in the controller// if(isset($this->params['url']['search'])){ echo 'search text has been found'; } Fair comment burzum
Deano at Stack Overflow Visit the source
Related Q & A:
- How to create a semantic search box and engines?Best solution by Stack Overflow
- How do I create a family tree form online?Best solution by familyecho.com
- How to create a simple counter program?Best solution by Stack Overflow
- How to create my own search engine?Best solution by Yahoo! Answers
- How to create a simple Facebook status update Application?Best solution by ilovefreesoftware.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.