Hi,
I'm somewhat new to CakePHP but working to get up to speed quickly.
I'm trying to understand the Events Systems. I've been able to successful
create events, define listeners, attach listeners and receive event objects
.... all within the same Model-Controller-Class. It works well and I've
managed to get comfortable with it. I've create a ProductsController and
within that class everything works well.
What I would like to do is define an event in Model-Controller-Class 'A'
(Product) and create a listener in Model-Controller-Class 'B' (Order). The
net effect would be that an event object is created as a result of some
action within 'A' and that event object is passed to 'B'. 'A' to 'A' or 'B'
to 'B' I can manage.
I've read about the Global Event Manager and that would seem to be the
ticket. However, the documentation doesn't provide a newcomer like me
sufficient depth to get it right. The documentation suggests the following:
// In any configuration file or piece of code that executes before the
eventApp::uses('CakeEventManager',
'Event');CakeEventManager::instance()->attach($aCallback,
'Model.Order.beforePlace');
So what configuration file or piece of code is recommended? AppController? And
where does the function go? In the same file? As you can see
the answer is not obvious enough to me to figure it out and I can't find any
examples on the internet.
Any suggestions of links or tutorials or hints would be appreciated. If I've
not provided enough enough information I'm happy to provide
that too!
Thanks, Jerry
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.