Re: Cakephp3 Events and Listeners

2015-11-13 Thread Phan Tuan Kiet
Hi all, help me about cakephp 3.x in cell 'action_right_table', ]; } public function action_right_table(Event $event, array $action_right_selects) { $event->data['action_right_selects'] = ['test'=>'test']; return true; } }

Re: Cakephp3 Events and Listeners

2014-08-22 Thread Rob Cowie
I have read the chapter, but my populateUserPrefs function does not fire. Is any one able to flesh out the example, or tell me that actually I cannot have a Table Model class implement EventListener? On Friday, 22 August 2014 04:36:03 UTC+1, Dr. Tarique Sani wrote: Event listeners are

Re: Cakephp3 Events and Listeners

2014-08-22 Thread Rob Cowie
OK, so i have my have my event listeners working now. I was attempting to fire the event from a controller in a different plugin, and had not understood that you need to use the global event manager, and need to register the listeners in the bootstrap of the plugin that contains the listener.

Cakephp3 Events and Listeners

2014-08-21 Thread Rob Cowie
Hi all. I have read the cakephp book on events in version 3, and I cannot seem to get it to work. I am missing a piece of comprehension. I have the event dispatch code in a controller: $event = new Event('Controller.User.login', $this); $this-eventManager()-dispatch($event); and I have a

Re: Cakephp3 Events and Listeners

2014-08-21 Thread Dr. Tarique Sani
Event listeners are implementations of Cake\Event\EventListener interface also then you have to attach your event - something like // Attach the UserStatistic object to the Order's event manager $statistics = new UserStatistic(); $this-Orders-eventManager()-attach($statistics); See