Hi Arvin,

What I do is I add a search action (similar to the index action) to the 
controller.

E.g. in my application I have hotels. So in my hotels_controller.php I have the 
function search and a view search.ctp in my hotels views folder.

Some searches that I do involve related models so it is worth to have a look at 
the containable behaviour (http://book.cakephp.org/view/474/Containable) and to 
keep your search parameters when paging have a look here: 
http://groups.google.ch/group/cake-php/msg/09277228f45365ac

So you will need a search action for each controller (with me it is hotels, 
images, texts, etc). But once your have crated a working search you can easily 
adapt it for your other models and your friends Copy, Paste, Find and Replace 
will help you.

HTH

Anja


-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[EMAIL PROTECTED] Im Auftrag von Arvin
Gesendet: Donnerstag, 20. November 2008 03:33
An: CakePHP
Betreff: Question on how to query


Ok, i'm new here. i'm new with CakePHP and even PHP itself. I've only done 
basic CRUD (create, read, update delete) using the cakephp blog tutorial.

I'm overwhelmed with the vast number of sites and forums that I dont know where 
to start looking for the answers to my question. So, i'm posting it here. Hope 
you can help me out.

What i understand from CakePHP is that every page needs to have a model and a 
controller and a database table of the same name.

eg.
database table: users
controller: users_controller.php
model: user.php
views: users folder

all the pages i've done have the basic add edit delete view pages in them.

now i want to do a search page. it would perform querying based on categories 
found on different tables of the database.

question now is, how do i start with it? do i create a new set of "reports" 
model, views, controller, and database table?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to