Cees Hek wrote: > On 7/5/05, Michael Peters <[EMAIL PROTECTED]> wrote: > >>Right, but how do you register a callback for init on this newly blessed >>object? You won't see it until after the init hook is already called. > > > Yup. That was one of the reasons I originally left out the init hook > when we only had object based callbacks. It was put back in when we > added class based callbacks. > > But a setup hook will not help you here either, since it is called > during 'new' as well. The reason I left off the setup hook is because > you can do everything you need to without it. The init phase happens > immediately before setup is called, and the prerun phase gets called > pretty much right afterward (during the run phase).
I guess I didn't notice that cause my 'setup' callback was never executed :) > So I never saw the use for a setup hook. It was one of those ones > that never looked like a hook to me. It is really in place for > overriding in your subclasses. Of course since most of those reasons > are opinion, you are welcome to disagree and implement a setup hook. > It won't affect me negatively, so I am not against it. I do agree that you can do everything in the init it just seemed odd to me that every other location in the C::A request cycle has a hook but setup didn't. Just a minor inconsitency though... > I think what you need to do to add extra runmodes is to set them in a > class based init callback. That is what I do. Is there really any > time where you selectively want an extra runmode based on the object > (are you checking PARAMs or something)? Shouldn't you always want > those runmodes available? Again, I agree. But maybe run modes are a bad example. I was just pointing out that init (and possibly setup) callbacks could never be registered on an object. And like I said, I couldn't come up with a good use case where this would matter. I guess I was asking if anyone else could. -- Michael Peters Developer Plus Three, LP --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[email protected]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
