예제 #1
0
 public function call(\Raptor\Raptor $app)
 {
     /**
      * Add to the inyector container the Interactive Instance
      * 
      */
     $app->getInyector()->add(new \Raptor2\InteractiveBundle\Manager\InteractiveManager());
     $user = '******';
     if ($app->getSecurity()->isAuthenticated()) {
         $array = $app->getSecurity()->getUser();
         $user = $array['username'];
     }
     $store = json_encode(array('reject' => false, 'tutoriales' => array('interactive' => 'This is interactive')));
     if ($app->getCookie('Interactive_' . $user, true) == NULL) {
         $app->setCookie('Interactive_' . $user, $store, strtotime('+1 year'));
     } else {
         $store = $app->getCookie('Interactive_' . $user, true);
     }
     $app->setViewPlugin('core_library_outside', $app->render("@InteractiveBundle/core/core.js.twig", array('url' => $app->request()->getUrl() . $app->request()->getScriptName() . '/interactive/core', 'perfil' => $store)));
     /**
      * Return false to continue the flow of routing
      */
     return false;
 }