|Kohana events, where to place them||#1|
I'm trying to understand the event system of Kohana. The only thing i don't understand is, where to place the Event::add code.
It should be in a place where it is executed before any events are fired. Or am I missing something?
What i want to achieve is to construct a class that is available everywhere, but don't realy want to hack it into Kohana.
Can anyone cast a light on this?
posted date: 2008-12-09 03:04:00
|Re: Kohana events, where to place them||#3|
I presume this is the PHP framework - kohanaphp.com/home
posted date: 2008-12-09 03:20:00
|Re: Kohana events, where to place them||#4|
Try adding in a hook with your Event::Add code.From the documentation:The power of hooks mainly comes from the Events class. Hooks are loaded before any of the events are started so you can attach a hook to an event
posted date: 2008-12-09 03:23:00
|Re: Kohana events, where to place them||#5|
I'll look into that. Thx
posted date: 2008-12-09 03:35:00
|Re: Kohana events, where to place them||#6|
Usually Event::add() and Event::replace() are placed in the Hook constructor. Hooks are loaded before the first event of system ('system.ready') so you can add your callback to every system or custom event.
posted date: 2009-02-17 00:13:00
|select page: « 1 »|