示例#1
0
 public function call(\Raptor\Raptor $app)
 {
     $app->setViewPlugin('raptor_bundle', $app->render("@exampleBundle/plugin.html.twig"));
     /**
      * Return false to continue the flow of routing
      */
     return false;
 }
示例#2
0
 public function call(\Raptor\Raptor $app)
 {
     $conf = $app->getConfigurationLoader()->getConfOption();
     $this->app = $app;
     if (isset($conf['raptor']['admin']) and isset($conf['raptor']['adminpass'])) {
         if (!$app->getSession()->get('admin_auth')) {
             $this->handleAuthenticationRequest($message, $conf);
             $app->response()->write($app->render('@systemBundle/Login/index.html.twig', array('error' => $message, 'username' => $this->app->request()->post('username'))));
             $app->contentType('text/html; charset=UTF-8');
             return true;
         }
     }
     return false;
 }
示例#3
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;
 }