delobelf@gmail.com
1/26/2017 - 1:30 PM

service container injection

service container injection

    rg_dashboard_ajax_csrf_extensions:
        class: RG\Dashboard\Extension\AjaxCsrfExtensions
        calls:
            - [ setContainer, [ '@service_container' ] ]
        tags:
            -  { name: twig.extension }
class AjaxCsrfExtensions extends Twig_Extension implements ContainerAwareInterface
{
    protected $container;

    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }
.
.
.
.