Browse Source

Corrections Controller non service dans bundle

Mael ETIENNE 3 years ago
parent
commit
8f51eac71c
2 changed files with 7 additions and 5 deletions
  1. 3
    5
      Controller/Track2004Controller.php
  2. 4
    0
      Resources/config/services.xml

+ 3
- 5
Controller/Track2004Controller.php View File

@@ -35,7 +35,7 @@ class Track2004Controller extends AbstractController
35 35
      * Donc, cette fonction a comme but de sauvgarder les données mises à jour par le sco, lors de ses interactions avec
36 36
      * le LMS
37 37
      */
38
-    public function commit(Request $request)
38
+    public function commit(Request $request, RouterInterface $router, ParameterBagInterface $params)
39 39
     {
40 40
         $em = $this->getDoctrine()->getManager();
41 41
 
@@ -370,11 +370,9 @@ class Track2004Controller extends AbstractController
370 370
 
371 371
 
372 372
         // Récupération des modifications du lecteur pour la réponse ajax
373
-        $packageFolder = $this->container->getParameter('logipro_scorm.package_folder');
373
+        $packageFolder = $params->get('logipro_scorm.package_folder');
374 374
         $dom = $registrationAttempt->getDOM($packageFolder);
375
-        $router = $this->container->get('router.default');
376
-        $parameters = $this->container->get('parameter_bag');
377
-        $playerView = new Scorm2004PlayerView($router, $parameters, $em, $dom, $track, $registrationKey, $organization, $item);
375
+        $playerView = new Scorm2004PlayerView($router, $params, $em, $dom, $track, $registrationKey, $organization, $item);
378 376
         $response = $playerView->getNavResponse();
379 377
 
380 378
         return $this->json($response);

+ 4
- 0
Resources/config/services.xml View File

@@ -4,6 +4,10 @@
4 4
     xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
5 5
 
6 6
     <services>
7
+        <defaults autowire="true" autoconfigure="true" public="false"/>
8
+        
9
+        <prototype namespace="Logipro\Bundle\SCORMBundle\Controller\" resource="../../Controller/*"/>
10
+        
7 11
         <service id="Logipro\Bundle\SCORMBundle\Services\ScormEngine" class="Logipro\Bundle\SCORMBundle\Services\ScormEngine" public="true">
8 12
             <argument type="service" id="router.default"/>
9 13
             <argument type="service" id="parameter_bag"/>

Loading…
Cancel
Save