Re: Reusable code, components and controllers.

2006-12-26 Thread phpjoy
great, gonna use this one! for some kinda reason, i didn't take into consideration that you can use var $components = array( 'Session' ); in a component.. sigh! :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Reusable code, components and controllers.

2006-12-25 Thread the_woodsman
That's probably the best practice, especialy if you might want to re-use this functionality in another app. Another approach might be to put this code in a method of your app_controller, (which you can override by making a copy of the standard Cake file), so that all controllers in your app inhe

RE: Reusable code, components and controllers.

2006-12-25 Thread Mariano Iglesias
be cool, and share your knowledge. BAKE ON! -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de phpjoy Enviado el: Lunes, 25 de Diciembre de 2006 10:24 a.m. Para: Cake PHP Asunto: Reusable code, components and controllers

Reusable code, components and controllers.

2006-12-25 Thread phpjoy
I have this code for my app, and I need to put it in a few controllers. I wonder where I can put it, so I could call it from the controllers. loadModel('Section'); $Section =& new Section; $this->Section =& new Section; $this->Section->id = $this->params['url']['section']; $section = $this->Sec