/**
  * @return array|string
  */
 public function encode()
 {
     if ($this->session->has($this->flash_key)) {
     }
     $messages = $this->session->get($this->flash_key);
     if ($messages == null) {
         return json_encode([]);
     }
     $this->session->set($this->flash_key, []);
     $encoded_messages = [];
     foreach ($messages as $msg) {
         array_push($encoded_messages, $msg->encode());
     }
     $encoded_messages = '[' . implode(',', $encoded_messages) . ']';
     return $encoded_messages;
     return json_encode([]);
 }
Ejemplo n.º 2
0
 /**
  * session 정보 업데이트
  *
  * @param array $session session information
  * @return void
  */
 private function putSession($session)
 {
     $this->session->set(self::SESSION_NAME, array_merge($this->session->get(self::SESSION_NAME), [$this->name => $session]));
 }
 public function get($key)
 {
     return $this->session->get($this->prefix_key . $key, null);
 }