Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
shutdown event
  • Hi.,
    Anyone give an example of the use of shutdown event.,
    I can't understand from Doc.,
    Thanks in advance.,
  • HarroHarro
    Accepted Answer
    The shutdown event is triggered after the output has been send to the browser and PHP is closing down. It is triggered through a registered shutdown function, and the framework itself uses it to write the session data to the session storage backend.

    You add an event using

    \Event::register('shutdown', $callback);

    where $callback is any valid PHP callback (see http://php.net/manual/en/language.types.callable.php).

    Say your controller as a shutdown function called shutdown(), you would use:

    \Event::register('shutdown', array($this, 'shutdown'));

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion