0 votes
in MVC Language by
Mention what "beforFilter()","beforeRender" and "afterFilter" functions do in Controller?

1 Answer

0 votes
by

beforeFilter(): This function is run before every action in the controller. It's the right place to check for an active session or inspect user permissions.

beforeRender(): This function is called after controller action logic, but before the view is rendered. This function is not often used, but may be required If you are calling render() manually before the end of a given action

afterFilter(): This function is called after every controller action, and after rendering is done. It is the last controller method to run

...