In which file do i need to write code for attaching listener for EventDispatcher in symfony2
===

IN the [symfony2 Docs][1] , they say to use this code


    $listener = new AcmeListener();
    $dispatcher->addListener('foo.action', array($listener, 'onFooAction'));

I have two questions


1. IN which file do i need to write that line
2. 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


  [1]: http://symfony.com/doc/current/components/event_dispatcher/introduction.html