Documentation

Filters extends BaseConfig
in package

Class BaseConfig

Not intended to be used on its own, this class will attempt to automatically populate the child class' properties with values from the environment.

These can be set within the .env file.

Table of Contents

$aliases  : array<string|int, mixed>
Configures aliases for Filter classes to make reading things nicer and simpler.
$filters  : array<string|int, mixed>
List of filter aliases that should run on any before or after URI patterns.
$globals  : array<string|int, mixed>
List of filter aliases that are always applied before and after every request.
$methods  : array<string|int, mixed>
List of filter aliases that works on a particular HTTP method (GET, POST, etc.).
$registrars  : array<string|int, mixed>
An optional array of classes that will act as Registrars for rapidly setting config class properties.
$didDiscovery  : bool
Has module discovery happened yet?
$moduleConfig  : Modules
The modules configuration.
__construct()  : mixed
Will attempt to get environment variables with names that match the properties of the child class.
getEnvValue()  : mixed
Retrieve an environment-specific configuration setting
initEnvValue()  : mixed
Initialization an environment-specific configuration setting
registerProperties()  : mixed
Provides external libraries a simple way to register one or more options into a config file.

Properties

$aliases

Configures aliases for Filter classes to make reading things nicer and simpler.

public array<string|int, mixed> $aliases = ['csrf' => CodeIgniterFiltersCSRF::class, 'toolbar' => CodeIgniterFiltersDebugToolbar::class, 'honeypot' => CodeIgniterFiltersHoneypot::class, "auth" => AppFiltersAuth::class, "noauth" => AppFiltersNoauth::class]

$filters

List of filter aliases that should run on any before or after URI patterns.

public array<string|int, mixed> $filters = []

Example: 'isLoggedIn' => ['before' => ['account/', 'profiles/']]

$globals

List of filter aliases that are always applied before and after every request.

public array<string|int, mixed> $globals = ['before' => [], 'after' => ['toolbar']]

$methods

List of filter aliases that works on a particular HTTP method (GET, POST, etc.).

public array<string|int, mixed> $methods = []

Example: 'post' => ['csrf', 'throttle']

$registrars

An optional array of classes that will act as Registrars for rapidly setting config class properties.

public static array<string|int, mixed> $registrars = []

$didDiscovery

Has module discovery happened yet?

protected static bool $didDiscovery = false

Methods

__construct()

Will attempt to get environment variables with names that match the properties of the child class.

public __construct() : mixed

The "shortPrefix" is the lowercase-only config class name.

Return values
mixed

getEnvValue()

Retrieve an environment-specific configuration setting

protected getEnvValue(string $property, string $prefix, string $shortPrefix) : mixed
Parameters
$property : string
$prefix : string
$shortPrefix : string
Return values
mixed

initEnvValue()

Initialization an environment-specific configuration setting

protected initEnvValue(mixed &$property, string $name, string $prefix, string $shortPrefix) : mixed
Parameters
$property : mixed
$name : string
$prefix : string
$shortPrefix : string
Return values
mixed

registerProperties()

Provides external libraries a simple way to register one or more options into a config file.

protected registerProperties() : mixed
Tags
throws
ReflectionException
Return values
mixed

Search results