Exemplo n.º 1
0
 /**
  * Our index action, show a lab.
  */
 public function indexAction()
 {
     $this->view->headScript()->appendFile("/js/taffydb/taffy.js")->appendFile("/js/labs/views/task.js")->appendFile("/js/labs/models/task.js")->appendFile("/js/labs/controllers/add_task.js")->appendFile("/js/labs/controllers/task_list.js");
     // Check for a code
     if (!$this->_request->has("code")) {
         throw new Exception(self::ERROR_NO_CODE, 404);
     }
     // get the passed code
     $code = $this->_request->getParam("code");
     $lab = $this->db->findOneByCode($code);
     // check if the code is valid
     if (!$lab instanceof App_Db_Lab) {
         throw new Exception(self::ERROR_INVALID_CODE, 404);
     }
     $this->view->lab = $lab;
     $this->view->headTitle($lab->name);
 }