Beispiel #1
0
 /**
  * Render the template
  * @return  string
  * @throws  Exception if file not found or error/exception in the template
  */
 public function render()
 {
     if (file_exists($this->_templatePath)) {
         $claroline = Claroline::getInstance();
         claro_ob_start();
         include $this->_templatePath;
         $render = claro_ob_get_contents();
         claro_ob_end_clean();
         return $render;
     } else {
         throw new Exception("Template file not found {$this->_templatePath}");
     }
 }
Beispiel #2
0
 /**
  * @see Claro_Controller_Script
  */
 public function handleRequest($userInput, $claroline)
 {
     if (!file_exists($this->scriptPath)) {
         throw new Exception("File not found " . $this->scriptPath);
         return false;
     } else {
         claro_ob_start();
         require_once $this->scriptPath;
         $output = claro_ob_get_contents();
         claro_ob_end_clean();
         return $output;
     }
 }