• Fabien Potencier's avatar
    merged branch GromNaN/on2 (PR #441) · e21c10f2
    Fabien Potencier authored
    This PR was merged into the master branch.
    
    Commits
    -------
    
    c4975cc4 Create Application::on() method to add an event listener
    
    Discussion
    ----------
    
    Add method Application::on($eventName, $callback, $priority)
    
    Simplify PR #435
    
    This method is a shortcut to add a listener to the event dispatcher.
    
    ``` php
    <?php
    use Symfony\Component\Security\Http\SecurityEvents;
    
    $app->on(SecurityEvents::SWITCH_USER, function ($event) {
        // ...
    });
    ```
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2012-10-24T20:34:12Z
    
    Can you add some useful examples in the documentation before I merge this PR? Thanks.
    
    ---------------------------------------------------------------------------
    
    by GromNaN at 2012-10-24T21:57:48Z
    
    Which part of the documentation would be the most relevant ?
    
    I can write a cookbook on how to send an email when someone login to the application.
    e21c10f2
Name
Last commit
Last update
..
Application Loading commit data...
EventListener Loading commit data...
Exception Loading commit data...
Provider Loading commit data...
Route Loading commit data...
Util Loading commit data...
Application.php Loading commit data...
Controller.php Loading commit data...
ControllerCollection.php Loading commit data...
ControllerProviderInterface.php Loading commit data...
ControllerResolver.php Loading commit data...
ExceptionHandler.php Loading commit data...
ExceptionListenerWrapper.php Loading commit data...
HttpCache.php Loading commit data...
LazyUrlMatcher.php Loading commit data...
RedirectableUrlMatcher.php Loading commit data...
Route.php Loading commit data...
ServiceProviderInterface.php Loading commit data...
WebTestCase.php Loading commit data...