Abstract Class Misago\ActionController\Filters

Filters permit to handle a request before and after executing an action.

Example:

class PostsController extends ApplicationController
{
  static __constructStatic()
  {
    static::before_filter('authenticate');
    static::before_filter('requires_login', array('except' => array('index', 'show')));
    static::after_filter('mark_searched_tokens', 'compress_response', array('only' => array('index')));
  }
} 

Before filters

Before filters are processed before processing the action. If a before_filter method returns false, the filters' chain will stop and the action won't be processed. This is useful for handling pages where the user must be authenticated, for instance.

After filters

After filters are run

Skip filters

After filters are run

Options:

All filters have the following options:

Inheritence

Extends:
Rescue

Methods

Protected static methods

append_after_filter($filter, $options=null)

append_before_filter($filter, $options=null)

prepend_before_filter($filter, $options=null)

skip_filter($filter)

Protected instance methods

prepend_after_filter($filter, $options=null)