Exemple #1
0
 public function make($layoutName, $viewResult)
 {
     if (!$layoutName) {
         throw new WebException($this->req->param('controller'), $this->req->param('action'), "Invalid layout name");
     } else {
         $layoutFilePath = self::getFilePath($layoutName);
         if (is_file($layoutFilePath) && is_readable($layoutFilePath)) {
             return new Layout($layoutFilePath, $viewResult);
         } else {
             throw new WebException($this->req->param('controller'), $this->req->param('action'), "Can't find layout file {$layoutFilePath}");
         }
     }
 }
Exemple #2
0
 public function __get($key)
 {
     if (isset($key) && array_key_exists($key, $this->data)) {
         return $this->data[$key];
     } else {
         throw new WebException($this->req->param('controller'), $this->req->param('action'), "Can't find [{$key}] in data.");
     }
 }