コード例 #1
0
ファイル: basecontroller.php プロジェクト: bitcalc/allspark
 public function __construct()
 {
     $this->request = RequestModel::currentRequest();
     // provide all controllers with access to the request data
     $this->session = SessionModel::currentSession();
     // provide all controllers with access to the session data
 }
コード例 #2
0
ファイル: htmlview.php プロジェクト: bitcalc/allspark
 public function __construct($error = false)
 {
     // Some checks shouldn't be done when we've encountered a fatal error, like a Redis issue, which will cause infinite recursion!
     if (!$error) {
         $session = SessionModel::currentSession();
         if ($user = $session->user()) {
             $flashQ = new FlashQueue($user);
             while ($flash = $flashQ->getFlash()) {
                 $this->globals['flash_queue'][] = $flash;
             }
             $this->globals['websites_with_access'] = array_map(function ($website) {
                 return get_object_vars($website);
                 // convert to array...
             }, $user->websitesWithAccess());
         }
     }
     // Globals
     $this->globals['app_name'] = AppConfig::getValue('app_name');
     // Clean Globals
     self::stripHTML($this->globals);
 }