IN the symfony2 Docs , they say to use this code
$listener = new AcmeListener();
$dispatcher->addListener('foo.action', array($listener, 'onFooAction'));
I have two questions
- IN which file do i need to write that line
- what other events i can write in first arguments like
foo.action. i mean is that event buitin or doctrine event or symfony event or custom defined
You have to write in your controller like this