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
Why couldn't you access session from a component? Add the Session component to the component you are creating, something like: class FetchSessionComponent extends Object { var $name = 'FetchSession'; var $components = array( 'Session' ); var $uses = 'Section';