From 7fe9eef04747be115c7372eb4f0d3e2795ade1e7 Mon Sep 17 00:00:00 2001 From: Leny BERNARD Date: Thu, 20 Oct 2016 00:44:35 +0200 Subject: [PATCH] get back twig extension to continue to render alerts with {{ app.session|alertify|raw }} --- Handler/AlertifySessionHandler.php | 2 +- Resources/config/services.xml | 11 +++++ Resources/views/pushjs.html.twig | 1 - Twig/Extension/AlertifyExtension.php | 66 ++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 Twig/Extension/AlertifyExtension.php diff --git a/Handler/AlertifySessionHandler.php b/Handler/AlertifySessionHandler.php index 5cd914f..040ab43 100644 --- a/Handler/AlertifySessionHandler.php +++ b/Handler/AlertifySessionHandler.php @@ -78,7 +78,7 @@ public function handle($session) * * @return array **/ - public function getDefaultParametersFromContext($context = null) + protected function getDefaultParametersFromContext($context = null) { if (count($this->defaultParameters['contexts'])) { //If context is not given, just take the default one diff --git a/Resources/config/services.xml b/Resources/config/services.xml index dd737de..83515d3 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -4,6 +4,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> + Troopers\AlertifyBundle\Twig\Extension\AlertifyExtension Troopers\AlertifyBundle\Handler\AlertifySessionHandler Troopers\AlertifyBundle\Helper\AlertifyHelper Troopers\AlertifyBundle\EventListener\AlertifyListener @@ -17,5 +18,15 @@ %troopers_alertify% + + + + + + + + + + diff --git a/Resources/views/pushjs.html.twig b/Resources/views/pushjs.html.twig index d53c1d2..972230b 100644 --- a/Resources/views/pushjs.html.twig +++ b/Resources/views/pushjs.html.twig @@ -1,4 +1,3 @@ -{{ dump(options) }}