This is the Ekino Wordpress plugin to interact with Symfony.
1) Put the following lines at the beginning of your wp-config.php
file, according to your project configuration:
define('WP_SYMFONY_PATH', __DIR__.'/symfony/');
define('WP_SYMFONY_ENVIRONMENT', 'dev');
define('WP_SYMFONY_DEBUG', true);
2) Enable the "Ekino Wordpress Symfony" plugin in WordPress Extensions list.
You can retrieve all Symfony services registered in the dependency injection container with the following method:
$service = \symfony_service('my.symfony.service.identifier');
This plugin allows Wordpress to dispatch some hooks on the Symfony EventDispatcher component.
An example with the three following hooks has been added: