$filters
$filters : array
The processed filters that will be used to check against.
Filters
$config : \CodeIgniter\Config\BaseConfig
The original config file
$request : \CodeIgniter\HTTP\RequestInterface
The active IncomingRequest or CLIRequest
$response : \CodeIgniter\HTTP\ResponseInterface
The active Response instance
__construct(\CodeIgniter\Filters\type $config, \CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response)
Constructor.
\CodeIgniter\Filters\type | $config | |
\CodeIgniter\HTTP\RequestInterface | $request | |
\CodeIgniter\HTTP\ResponseInterface | $response |
setResponse(\CodeIgniter\HTTP\ResponseInterface $response)
Set the response explicity.
\CodeIgniter\HTTP\ResponseInterface | $response |
run(string $uri, string $position = 'before') : \CodeIgniter\HTTP\RequestInterface|\CodeIgniter\HTTP\ResponseInterface|mixed
Runs through all of the filters for the specified uri and position.
string | $uri | |
string | $position |
initialize(string $uri = null) : \CodeIgniter\Filters\Filters
Runs through our list of filters provided by the configuration object to get them ready for use, including getting uri masks to proper regex, removing those we can from the possibilities based on HTTP method, etc.
The resulting $this->filters is an array of only filters that should be applied to this request.
We go ahead an process the entire tree because we'll need to run through both a before and after and don't want to double process the rows.
string | $uri |
addFilter(string $class, string|null $alias = null, string $when = 'before', string $section = 'globals') : $this
Adds a new alias to the config file.
MUST be called prior to initialize(); Intended for use within routes files.
string | $class | |
string|null | $alias | |
string | $when | |
string | $section |
enableFilter(string $name, string $when = 'before') : \CodeIgniter\Filters\Filters
Ensures that a specific filter is on and enabled for the current request.
Filters can have "arguments". This is done by placing a colon immediately after the filter name, followed by a comma-separated list of arguments that are passed to the filter when executed.
string | $name | |
string | $when |