Search code examples
phpkohanamessagekohana-3kohana-3.0

Which is the best way to display 'flash messages' in kohana v3?


I would like to know the best way to display flash messages in Kohana v3?

Some tutorials or examples would be helpful.


Solution

  • Do you mean like Kohana 2.x's flash session variables?

    The latest Kohana supports get_once() which is pretty similar to the old flash session variables.

    $session = Session::instance();
    
    $session->set('test', 'Hello, World!');
    
    // The session variable is returned and removed.
    $test = $session->get_once('test');