Esempio n. 1
0
 public function clear($type = null)
 {
     if ($type !== null) {
         unset($this->messages[$type]);
         $this->save();
     } else {
         Session::destroy(self::KEY);
     }
 }
Esempio n. 2
0
 protected function setInputValues()
 {
     if (Session::exists($this->_inputSessionKey)) {
         $values = Session::get($this->_inputSessionKey);
         foreach ($values as $key => $value) {
             $item = input()->getObject($key, new InputItem($key), ['get', 'post'])->setValue($value);
             if (request()->getMethod() === 'post') {
                 input()->post[$key] = $item;
             } else {
                 input()->get[$key] = $item;
             }
         }
         Session::destroy($this->_inputSessionKey);
     }
 }