Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
shutdown event
Sibin
April 2016
Hi.,
Anyone give an example of the use of shutdown event.,
I can't understand from Doc.,
Thanks in advance.,
Harro
April 2016
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'));
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
April 2016