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. Are you saying that you prefer to use
requestAction even when you could query the (associated) model?
I hope not, others might follow that and prompt the next round of "what
can I do to speed up my app" messages :P.
AD7six
Please note:
The manual/bakery is a good place to start any quest for info.
The cake search (at the time of writing) erroneously reports less/no
results for the google group.
The wiki may contain incorrect info - read at your own risk (it's
mainly user submitted) :) You may get your answer quicker by asking on
the IRC Channel (you can access it with just a browser
here:http://irc.cakephp.org).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---