Exemple #1
0
 public function beforeMethod()
 {
     $this->mUsers = new mUsers();
     $this->auth = new Auth($this->mUsers, $this->config);
     if (Dragon::$method != 'login' && !$this->auth->check()) {
         $this->router->redirect($this->config->get('project_host'));
     }
     parent::beforeMethod();
     $this->view->setLayout('default');
     Assets::add('main', Assets::TYPE_CSS);
     Assets::add('default', Assets::TYPE_JS);
 }
 /**
  * Homepage -- default method
  */
 public function index()
 {
     Debug::timer('test');
     Assets::add('main', Assets::TYPE_CSS);
     Assets::add('default', Assets::TYPE_JS);
     /*
      * Sample information about access to database data
      * Default read:
      */
     //        $modelSample = new mSample();
     //        $rows = $modelSample->get();
     //        Debug::var_dump($rows);
     //        $modelSample->get(2);
     /*
      * Sample get instance of component
      */
     $componentEmail = new cEmail($this->config, $this->router);
     Debug::var_dump('test');
     Debug::var_dump([432, 654]);
     Debug::timer('test');
     $this->set('variable', 'how to set variable to view');
     $this->set('links', array('produkt' => $this->router->getUrl('products', 'detail', 123, array('list' => 5))));
 }