CodeIgniter v4.5 API

View extends BaseConfig
in package

View configuration

Tags
phpstan-type

parser_callable (callable(mixed): mixed)

phpstan-type

parser_callable_string (callable(mixed): mixed)&string

Table of Contents

Properties

$decorators  : array<int, ViewDecoratorInterface>>
View Decorators are class methods that will be run in sequence to have a chance to alter the generated output just prior to caching the results.
$filters  : array<string, string>
Parser Filters map a filter name with any PHP callable. When the Parser prepares a variable for display, it will chain it through the filters in the order defined, inserting any parameters.
$override  : bool
Whether to override properties by Env vars and Registrars.
$plugins  : array<string, callable|array<int, string>|string>
Parser Plugins provide a way to extend the functionality provided by the core Parser by creating aliases that will be replaced with any callable. Can be single or tag pair.
$registrars  : array<string|int, mixed>
An optional array of classes that will act as Registrars for rapidly setting config class properties.
$saveData  : bool
When false, the view method will clear the data between each call.
$coreFilters  : array<string, string>
Built-in View filters.
$corePlugins  : array<string, callable|array<int, string>|string>
Built-in View plugins.
$didDiscovery  : bool
Has module discovery happened yet?
$moduleConfig  : Modules|null
The modules configuration.

Methods

__construct()  : mixed
Merge the built-in and developer-configured filters and plugins, with preference to the developer ones.
__set_state()  : mixed
getEnvValue()  : string|null
Retrieve an environment-specific configuration setting
initEnvValue()  : void
Initialization an environment-specific configuration setting
registerProperties()  : void
Provides external libraries a simple way to register one or more options into a config file.

Properties

$decorators

View Decorators are class methods that will be run in sequence to have a chance to alter the generated output just prior to caching the results.

public array<int, ViewDecoratorInterface>> $decorators = []

All classes must implement CodeIgniter\View\ViewDecoratorInterface

$filters

Parser Filters map a filter name with any PHP callable. When the Parser prepares a variable for display, it will chain it through the filters in the order defined, inserting any parameters.

public array<string, string> $filters = []

To prevent potential abuse, all filters MUST be defined here in order for them to be available for use within the Parser.

Tags
psalm-suppress

UndefinedDocblockClass

phpstan-var

array<string, parser_callable_string>

$override

Whether to override properties by Env vars and Registrars.

public static bool $override = true

$plugins

Parser Plugins provide a way to extend the functionality provided by the core Parser by creating aliases that will be replaced with any callable. Can be single or tag pair.

public array<string, callable|array<int, string>|string> $plugins = []
Tags
psalm-suppress

UndefinedDocblockClass

phpstan-var

array<string, list<parser_callable_string>|parser_callable_string|parser_callable>

$registrars

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

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

$saveData

When false, the view method will clear the data between each call.

public bool $saveData = true

$coreFilters

Built-in View filters.

protected array<string, string> $coreFilters = ['abs' => '\abs', 'capitalize' => '\CodeIgniter\View\Filters::capitalize', 'date' => '\CodeIgniter\View\Filters::date', 'date_modify' => '\CodeIgniter\View\Filters::date_modify', 'default' => '\CodeIgniter\View\Filters::default', 'esc' => '\CodeIgniter\View\Filters::esc', 'excerpt' => '\CodeIgniter\View\Filters::excerpt', 'highlight' => '\CodeIgniter\View\Filters::highlight', 'highlight_code' => '\CodeIgniter\View\Filters::highlight_code', 'limit_words' => '\CodeIgniter\View\Filters::limit_words', 'limit_chars' => '\CodeIgniter\View\Filters::limit_chars', 'local_currency' => '\CodeIgniter\View\Filters::local_currency', 'local_number' => '\CodeIgniter\View\Filters::local_number', 'lower' => '\strtolower', 'nl2br' => '\CodeIgniter\View\Filters::nl2br', 'number_format' => '\number_format', 'prose' => '\CodeIgniter\View\Filters::prose', 'round' => '\CodeIgniter\View\Filters::round', 'strip_tags' => '\strip_tags', 'title' => '\CodeIgniter\View\Filters::title', 'upper' => '\strtoupper']
Tags
psalm-suppress

UndefinedDocblockClass

phpstan-var

array<string, parser_callable_string>

$corePlugins

Built-in View plugins.

protected array<string, callable|array<int, string>|string> $corePlugins = ['csp_script_nonce' => '\CodeIgniter\View\Plugins::cspScriptNonce', 'csp_style_nonce' => '\CodeIgniter\View\Plugins::cspStyleNonce', 'current_url' => '\CodeIgniter\View\Plugins::currentURL', 'previous_url' => '\CodeIgniter\View\Plugins::previousURL', 'mailto' => '\CodeIgniter\View\Plugins::mailto', 'safe_mailto' => '\CodeIgniter\View\Plugins::safeMailto', 'lang' => '\CodeIgniter\View\Plugins::lang', 'validation_errors' => '\CodeIgniter\View\Plugins::validationErrors', 'route' => '\CodeIgniter\View\Plugins::route', 'siteURL' => '\CodeIgniter\View\Plugins::siteURL']
Tags
psalm-suppress

UndefinedDocblockClass

phpstan-var

array<string, array<parser_callable_string>|parser_callable_string|parser_callable>

$didDiscovery

Has module discovery happened yet?

protected static bool $didDiscovery = false

$moduleConfig

The modules configuration.

protected static Modules|null $moduleConfig

Methods

__construct()

Merge the built-in and developer-configured filters and plugins, with preference to the developer ones.

public __construct() : mixed

__set_state()

public static __set_state(array<string|int, mixed> $array) : mixed
Parameters
$array : array<string|int, mixed>

getEnvValue()

Retrieve an environment-specific configuration setting

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

initEnvValue()

Initialization an environment-specific configuration setting

protected initEnvValue(array<string|int, mixed>|bool|float|int|string|null &$property, string $name, string $prefix, string $shortPrefix) : void
Parameters
$property : array<string|int, mixed>|bool|float|int|string|null
$name : string
$prefix : string
$shortPrefix : string

registerProperties()

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

protected registerProperties() : void
Tags
throws
ReflectionException

        
On this page

Search results