Example #1
0
 /**
  * directory where the view templates are located
  *
  * @param string $dir directory where the view templates are located
  *
  * @return void
  * @throws InvalidArgumentException
  */
 public function setTemplateDir($dir)
 {
     if (substr($dir, 0, 1) != DIRECTORY_SEPARATOR && defined('SYNERGY_ROOT_DIR')) {
         $dir = SYNERGY_ROOT_DIR . DIRECTORY_SEPARATOR . $dir;
     }
     if (!is_dir($dir)) {
         throw new InvalidArgumentException(sprintf("Invalid template directory, %s", $dir));
     } else {
         if (!is_readable($dir)) {
             throw new InvalidArgumentException(sprintf("Template directory %s not readable", $dir));
         } else {
             $this->request->setTemplateDir($dir);
             $this->templateDir = $dir;
         }
     }
 }