Example #1
0
 public function getLayout($data = null)
 {
     $layout = null;
     if (is_array($data) && array_key_exists(self::LAYOUT_KEY, $data)) {
         $layout = $data[self::LAYOUT_KEY];
         unset($data[self::LAYOUT_KEY]);
     }
     if ($this->has(self::LAYOUT_KEY)) {
         $layout = $this->get(self::LAYOUT_KEY);
         $this->remove(self::LAYOUT_KEY);
     }
     if (is_null($layout)) {
         $app = Application::getInstance();
         $layout = $app->config(self::LAYOUT_KEY);
     }
     if (is_null($layout)) {
         $layout = self::DEFAULT_LAYOUT;
     }
     if ($layout == null) {
         return $layout;
     } else {
         return 'layouts/' . $layout . '.php';
     }
 }
Example #2
0
 public static function notify($name, $args = null)
 {
     Application::getInstance()->applyHook($name, $args);
 }