Esempio n. 1
0
 /**
  *
  * 
  */
 public function __construct()
 {
     $connectionOptions = Options::of('database');
     try {
         $this->connection = new \PDO($connectionOptions['dsn'], $connectionOptions['user'], $connectionOptions['pass']);
         $this->connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
     } catch (PDOException $e) {
         $e->getMessage();
     }
 }
Esempio n. 2
0
 /**
  * Render View
  * @param  string $name    
  * @param  array  $options 
  * @return string          
  */
 public static function make($name, $options = [])
 {
     $theme = !isset($options['theme']) ? '_default' : $options['theme'];
     $title = !isset($options['title']) ? '' : $options['title'];
     $params = !isset($options['params']) ? [] : $options['params'];
     $themeOptions = Options::ofTheme($theme);
     $header = Ui::render(self::themePath($theme, 'header'), $themeOptions['header']);
     $footer = Ui::render(self::themePath($theme, 'footer'), $themeOptions['footer']);
     $params['title'] = $title;
     $content = Ui::render(self::viewPath($name), $params);
     return Ui::render(self::themePath($theme), ['title' => $title, 'header' => $header, 'footer' => $footer, 'content' => $content, 'assets' => $themeOptions['assets']]);
 }
Esempio n. 3
0
 /**
  * @param string $module
  */
 private function setModuleOptions($module)
 {
     $this->moduleOptions = Options::ofModule($module);
 }