public function message($type, $message)
    {
        if ( $this->session->has('flashMessages') ) {
            $flashMessages = $this->session->get('flashMessages');
            $flashMessages[] = ['type' => $type, 'message' => $message];
            $this->session->set('flashMessages', $flashMessages);
        } else {
            $this->session->set('flashMessages', [['type' => $type, 'message' => $message]]);
        }
    }
public function message($type, $message)
    {
        if ( $this->session->has('flashMessages') ) {
            $flashMessages = $this->session->get('flashMessages');
            $flashMessages[] = ['type' => $type, 'message' => $message];
            $this->session->set('flashMessages', $flashMessages);
        } else {
            $this->session->set('flashMessages', [['type' => $type, 'message' => $message]]);
        }
    }
public function message ( $ type , $ message ) { if ( $ this -> session -> has ( 'flashMessages' ) ) { $ flashMessages = $ this -> session -> get ( 'flashMessages' ) ; $ flashMessages [ ] = [ 'type' => $ type , 'message' => $ message ] ; $ this -> session -> set ( 'flashMessages' , $ flashMessages ) ; } else { $ this -> session -> set ( 'flashMessages' , [ [ 'type' => $ type , 'message' => $ message ] ] ) ; } }
Saves the message in the session.
@param  string $type    The type of flash message. Will be the class of the output div.
@param  string $message The message to output.
@return void
Saves the message in the session .