My controller is also around 300 kb. I've kind of inherited it, not my
basic design and I don't have time (or permission) to make any changes
like pushing functionality down to the models. The models is also
based upon a 3rd party API so there is a bookingservice which is
modelled in the booking.php model etc.

Is there a performance hit having a large controller? Would I get a
performance hit dividing the controller into components for each web
page and/or splitting the controller into perhaps booking / user /
invoice controllers?

Thanks for any input!

/Jonas

On Apr 1, 3:29 pm, "rich...@home" <richardath...@gmail.com> wrote:
> 300kb sounds very large for even a complex controller.
>
> Don't forget: Fat Model, Skinny Controller
>
> Move all your controller queries into the model as methods, that
> should slim down the controllers a bit
>
> On Apr 1, 1:27 pm, euromark <dereurom...@googlemail.com> wrote:
>
>
>
> > sure
> > i did that with the user controller (used to be > 300kb)
>
> > e.g. controllers:
> > account (for changing account infos)
> > members (pagination and profiles)
> > overview (user statistics and stuff)
> > with their own views!
>
> > just use
> > $uses = array('User');
> > in all controllers to be able to use the same model+table
>
> > On 1 Apr., 12:27, Jeremy Burns <jeremybu...@me.com> wrote:
>
> > > You could move the functionality to a 
> > > component?http://book.cakephp.org/view/993/Components
>
> > > Jeremy Burns
> > > jeremybu...@me.com
> > > On 1 Apr 2010, at 11:25, Jonas wrote:
>
> > > > Hello,
>
> > > > Is there some recommended way of splitting a controller into several
> > > > files? It's getting a bit too large for my taste but I cannot move the
> > > > functionality out to the models. I would rather have the possibility
> > > > of putting a separate page in a separate file. Is this possible with
> > > > Cake?
>
> > > > It's a booking site btw if it makes any difference.
>
> > > > Regards,
> > > > Jonas
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > > with their CakePHP related questions.
>
> > > > 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
> > > > cake-php+unsubscr...@googlegroups.com For more options, visit this 
> > > > group athttp://groups.google.com/group/cake-php?hl=en
>
> > > > To unsubscribe, reply using "remove me" as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to