• 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
bin Loading commit data...
doc Loading commit data...
src/Silex Loading commit data...
tests Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
composer.json Loading commit data...
phpunit.xml.dist Loading commit data...