PHP code example of robinvdvleuten / lazy-event-dispatcher
1. Go to this page and download the library: Download robinvdvleuten/lazy-event-dispatcher library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
robinvdvleuten / lazy-event-dispatcher example snippets
namespace AppBundle;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(
new RegisterListenersPass('app.lazy_event_dispatcher', 'lazy.event_listener', 'lazy.event_subscriber'),
PassConfig::TYPE_BEFORE_REMOVING
);
}
}