> -----Messaggio originale-----
> Da: [email protected] 
> [mailto:[EMAIL PROTECTED] Per conto di AD7six
> Inviato: venerdì 26 gennaio 2007 14.21
> A: Cake PHP
> Oggetto: Re: Component vs. AppController vs. requestAction
> 
> 
> 
> 
> On Jan 26, 11:23 am, "marco" <[EMAIL PROTECTED]> wrote:
> > Hello All folks this is my first post.
> > I'm using cakephp for a intranet project in my company.
> > In my opinion the requestAction is the best method to mantain code
> > readability with large projects.
> > In my approach:
> > 1. Every controller maps its own model for CRUD:
> > 2. Expose methods like read, find, generatelist etc for interprocess
> > call.
> > for example in {Users Controller} that uses {User Model} I have the
> > function read($id) to return data to everyone needs a user record.
> > Really you don't need to declare the function in every 
> controller but
> > you can easily  move the logic in app_controller with something like
> >
> > function read( $id=null ) {
> >   // Its only an example
> >   if($id) {
> >     $this->{$this-modelclass}->id = $id;
> >     return $this->{$this-modelclass}->read();
> >   }
> >   return null;
> >
> > }It's my opinion would be glad to see yours
> > cheers.
> > Marco
> 
> Making use of $this->modelClass and class inheritance is a nice
> (standard?) technique. 

Ohps I know that my english is bad but I really think that have not said
this
> Are you saying that you prefer to use
> requestAction even when you could query the (associated) model?

I said that for me it's better to use only one model (the ref. model) for
each controller.
And use requestAction from one controller that not owned a model insted of
adding that model and duplicate actions.
I don't know of standards or best practices, I am curious instead to know
how others approach the problems.

> I hope not, others might follow that 
Even I :)
> and prompt the next 
> round of "what can I do to speed up my app" messages :P.

Regards


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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