This has been fixed in 1.2, so no, you should not need to call it manually.
On Jun 18, 11:29 am, Falagar <[EMAIL PROTECTED]> wrote: > Is it save to call the startup method manually? > > I had a case where I wanted to use a cookie in beforeFilter and ended > up calling the startup method for the Cookie component manually and it > seems to work. Anything that's wrong with that or am I misusing > something? > > On Jun 18, 5:02 am, AD7six <[EMAIL PROTECTED]> wrote: > > > On Jun 18, 1:18 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > In 1.1 and 1.2 Dispatcher::start() first calls beforeFilter() and then > > > the startup methods of components. This leads to a situation where in > > > beforeFilter() components are available (constructed) already, but > > > their startup() method wasn't called yet - although you would expect > > > that. > > > > Is it intentional to call beforeFilter first and initialize the > > > components after? > > > Components can have a initialize method, which is run immediately > > after they are instanciated, and a startup method which is run after > > the controller beforeFIlter. > > > see the foreach loop in this > > methodhttps://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/controlle... > > > Note that components extend object, that link is to the cake class > > which handles instanciating components, it isn't the base class for > > them. The beforeFilter is run sometime after that. (handled in the > > dispatcher if you are curious) > > > hth, > > > AD --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
