Request Life-cycle callbacks in CakePHP

CakePHP controllers come fitted with callbacks you can use to insert logic around the request life-cycle:
This function is executed before every action in the controller. It’s a handy place to check for an active
session or inspect user permissions.
Note: The beforeFilter() method will be called for missing actions, and scaffolded actions.
Called after controller action logic, but before the view is rendered. This callback is not used often,
but may be needed if you are calling render() manually before the end of a given action.
Called after every controller action, and after rendering is complete. This is the last controller method
to run.
In addition to controller life-cycle callbacks, Components also provide a similar set of callbacks.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s