]> Raphaël G. Git Repositories - airbundle/commitdiff
Cleanup
authorRaphaël Gertz <git@rapsys.eu>
Thu, 7 Nov 2019 03:48:54 +0000 (04:48 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 7 Nov 2019 03:48:54 +0000 (04:48 +0100)
Retrieve alias from central getAlias() function

Controller/DefaultController.php

index f7df53b9387d215fd1b12315b5def2f87b68ca72..b0aed10306b0d08891cc24732f149f9ed7812fe3 100644 (file)
@@ -11,7 +11,6 @@ use Rapsys\AirBundle\Entity\Session;
 use Rapsys\AirBundle\Entity\Application;
 use Symfony\Component\Form\FormError;
 
 use Rapsys\AirBundle\Entity\Application;
 use Symfony\Component\Form\FormError;
 
-#class DefaultController extends Controller {
 class DefaultController extends AbstractController {
        //Config array
        protected $config;
 class DefaultController extends AbstractController {
        //Config array
        protected $config;
@@ -21,7 +20,7 @@ class DefaultController extends AbstractController {
 
        public function __construct(ContainerInterface $container, Translator $translator) {
                //Retrieve config
 
        public function __construct(ContainerInterface $container, Translator $translator) {
                //Retrieve config
-               $this->config = $container->getParameter('rapsys_air');
+               $this->config = $container->getParameter($this->getAlias());
 
                //Set the translator
                $this->translator = $translator;
 
                //Set the translator
                $this->translator = $translator;
@@ -318,4 +317,11 @@ class DefaultController extends AbstractController {
 
                return $this->render('@RapsysAir/admin/session.html.twig', ['title' => $title, 'section' => $section, /*'form' => $form->createView(),*/ 'session' => $session]);
        }
 
                return $this->render('@RapsysAir/admin/session.html.twig', ['title' => $title, 'section' => $section, /*'form' => $form->createView(),*/ 'session' => $session]);
        }
+
+       /**
+        * {@inheritdoc}
+        */
+       public function getAlias() {
+               return 'rapsys_air';
+       }
 }
 }