Re: Cake php Controller Structure

2008-10-07 Thread David C. Zentgraf

Think of the controllers/actions as pages on your website.
If it makes sense to do everything on one page (i.e. in one action)  
than do that.
Just because models and controllers of the same name are automatically  
linked doesn't mean you shouldn't or can't use other models as well.

On 8 Oct 2008, at 05:53, Ahmed wrote:


 I am trying to make an action that involves using several models for
 example:

 There is a ticket and an order.
 I want to create a controller that creates a ticket then it creates an
 order for that ticket.

 Should i create a new controller for this action or should the action
 be included in the tickets_controller.php file  or the
 orders_controller.php

 What is the conventional way to creating custom controller actions
 that do tasks that involve several models.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Cake php Controller Structure

2008-10-07 Thread teknoid

This could help:
http://teknoid.wordpress.com/2008/08/01/practical-use-of-saveall-part-1-working-with-multiple-models/

I've also added a shortened version of this in the manual

On Oct 7, 4:53 pm, Ahmed [EMAIL PROTECTED] wrote:
 I am trying to make an action that involves using several models for
 example:

 There is a ticket and an order.
 I want to create a controller that creates a ticket then it creates an
 order for that ticket.

 Should i create a new controller for this action or should the action
 be included in the tickets_controller.php file  or the
 orders_controller.php

 What is the conventional way to creating custom controller actions
 that do tasks that involve several models.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---