TemplateHooks
in package
Class TemplateHooks
Tags
Table of Contents
- PRIORITY_NEUTRAL = 50
- $actions : array<string|int, mixed>
- $current_filter : mixed
- $filters : array<string|int, mixed>
- $merged_filters : array<string|int, mixed>
- $template_functions : array<string|int, mixed>
- __construct() : mixed
- _call_all_hook() : mixed
- Call "All" Hook
- add_action() : mixed
- add_filter() : bool
- Добавляет фильтр
- apply_filters() : false|mixed
- Вызываает фильтр
- do_action() : bool
- Выполняет дейсвие которое зарагестрировано на данный хукк
- has_filter() : bool|mixed
- Проверяет есть ли фильтры под данным тэгом
- registerTemplateHooks() : mixed
- remove_all_filters() : bool
- Удаляет все фильтры для данного тэга
- remove_filter() : bool
- Удаляет фильтр
- _filter_build_unique_id() : false|string
Constants
PRIORITY_NEUTRAL
public
mixed
PRIORITY_NEUTRAL
= 50
Tags
Properties
$actions
protected
array<string|int, mixed>
$actions
= array()
$current_filter
protected
mixed
$current_filter
= array()
$filters
protected
array<string|int, mixed>
$filters
= array()
$merged_filters
protected
array<string|int, mixed>
$merged_filters
= array()
$template_functions
private
array<string|int, mixed>
$template_functions
= array()
Methods
__construct()
public
__construct(array<string|int, mixed> $template_functions) : mixed
Parameters
- $template_functions : array<string|int, mixed>
Return values
mixed —_call_all_hook()
Call "All" Hook
public
_call_all_hook(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
Return values
mixed —add_action()
public
add_action(mixed $tag, mixed $function_to_add[, mixed $priority = self::PRIORITY_NEUTRAL ][, mixed $include_path = null ]) : mixed
Parameters
- $tag : mixed
- $function_to_add : mixed
- $priority : mixed = self::PRIORITY_NEUTRAL
- $include_path : mixed = null
Return values
mixed —add_filter()
Добавляет фильтр
public
add_filter(string $tag, $function_to_add[, int $priority = self::PRIORITY_NEUTRAL ][, null $include_path = null ]) : bool
Parameters
- $tag : string
-
Тэг за которым закрепляется фильтр
- $function_to_add :
- $priority : int = self::PRIORITY_NEUTRAL
-
Приоритет
- $include_path : null = null
Return values
bool —apply_filters()
Вызываает фильтр
public
apply_filters(string $tag, mixed $value) : false|mixed
Parameters
- $tag : string
-
Тэг по которым ищется нужный фильтр
- $value : mixed
Return values
false|mixed —do_action()
Выполняет дейсвие которое зарагестрировано на данный хукк
public
do_action( $tag[, string $arg = '' ]) : bool
Parameters
Return values
bool —has_filter()
Проверяет есть ли фильтры под данным тэгом
public
has_filter(string $tag[, false $function_to_check = false ]) : bool|mixed
Parameters
- $tag : string
-
Тэг который проверяют на наличия фильтров
- $function_to_check : false = false
Return values
bool|mixed —registerTemplateHooks()
public
registerTemplateHooks(Engine $latte, Presenter $presenter) : mixed
Parameters
- $latte : Engine
- $presenter : Presenter
Return values
mixed —remove_all_filters()
Удаляет все фильтры для данного тэга
public
remove_all_filters(string $tag[, int|null $priority = null ]) : bool
Parameters
- $tag : string
-
Название тэга
- $priority : int|null = null
Return values
bool —remove_filter()
Удаляет фильтр
public
remove_filter(string $tag, $function_to_remove[, int $priority = self::PRIORITY_NEUTRAL ]) : bool
Parameters
- $tag : string
-
Тэк за которым закрепляется фильтр
- $function_to_remove :
- $priority : int = self::PRIORITY_NEUTRAL
Return values
bool —_filter_build_unique_id()
private
_filter_build_unique_id( $function) : false|string