]> git.agnieray.net Git - galette.git/commitdiff
Replace deprecated call
authorJohan Cwiklinski <johan@x-tnd.be>
Thu, 11 Jun 2020 16:25:52 +0000 (18:25 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Thu, 11 Jun 2020 16:25:52 +0000 (18:25 +0200)
galette/includes/dependencies.php

index 7f61b03b9d2b176974544f883d4e2fc1575796ea..03a698b384027cabac0ab8f77ba4fa85e095cf4b 100644 (file)
@@ -35,6 +35,7 @@
 
 use Galette\Entity\PdfModel;
 use Slim\Event\SlimEventManager;
+use Slim\Views\SmartyPlugins;
 
 $container = $app->getContainer();
 
@@ -77,7 +78,9 @@ $container['view'] = function ($c) {
         '',
         $c->get('request')->getUri()->getBasePath()
     );
-    $view->addSlimPlugins($c->get('router'), $basepath);
+    $smartyPlugins = new SmartyPlugins($c['router'], $basepath);
+    $view->registerPlugin('function', 'path_for', [$smartyPlugins, 'pathFor']);
+    $view->registerPlugin('function', 'base_url', [$smartyPlugins, 'baseUrl']);
 
     $smarty = $view->getSmarty();
     $smarty->inheritance_merge_compiled_includes = false;