Пример #1
0
 public function app_init(&$params)
 {
     $shutdown = function () {
         $list = session('__FALSHDATA__');
         if ($list && null != ($list = json_decode($list))) {
             foreach ($list as $k) {
                 session($k, null);
             }
         }
         $flashdata = null;
         $list = \Org\Util\FlashData::getList();
         if ($list) {
             $flashdata = json_encode($list);
         }
         session('__FALSHDATA__', $flashdata);
     };
     register_shutdown_function($shutdown);
 }
Пример #2
0
 private function _flashRediect($message = '', $type = 'success', $url = '')
 {
     FlashData::flash('__SYS_MESSAGE__', $message);
     FlashData::flash('__SYS_MESSAGE_TYPE__', $type);
     if (empty($url)) {
         $url = $_SERVER['HTTP_REFERER'];
     }
     redirect($url);
 }