PHP Класс PodsView, pods

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$cache_modes array Array of available cache modes

Открытые методы

Метод Описание
clear ( string | boolean $key = true, string $cache_mode = null, string $group = '' ) : boolean
expires ( array | boolean | integer $expires, string $cache_mode = 'cache' ) : boolean | integer Advanced $expires handling
get ( string $key, string $cache_mode = 'cache', string $group = '', string $callback = null ) : boolean | mixed | null | void
get_key ( string $key, string $group_key = '' ) : string Get the cache key, salted with current Pods version, peppered with md5 if too long
get_template_part ( $_view, null | array $_data = null ) : boolean | mixed | string | void
set ( string $key, mixed $value, integer $expires, string $cache_mode = null, string $group = '' ) : boolean | mixed | null | string | void
view ( string $view, array | null $data = null, boolean | integer | array $expires = false, string $cache_mode = 'cache' ) : boolean | mixed | null | string | void

Приватные методы

Метод Описание
__construct ( ) : PodsView
locate_template ( $_view ) : boolean | mixed | string | void

Описание методов

clear() публичный статический Метод

С версии: 2.0
public static clear ( string | boolean $key = true, string $cache_mode = null, string $group = '' ) : boolean
$key string | boolean Key for the cache
$cache_mode string (optional) Decides the caching method to use for the view.
$group string (optional) Set the group.
Результат boolean

expires() публичный статический Метод

Advanced $expires handling
С версии: 3.0
public static expires ( array | boolean | integer $expires, string $cache_mode = 'cache' ) : boolean | integer
$expires array | boolean | integer
$cache_mode string
Результат boolean | integer

get() публичный статический Метод

С версии: 2.0
public static get ( string $key, string $cache_mode = 'cache', string $group = '', string $callback = null ) : boolean | mixed | null | void
$key string Key for the cache
$cache_mode string (optional) Decides the caching method to use for the view.
$group string (optional) Set the group of the value.
$callback string (optional) Callback function to run to set the value if not cached.
Результат boolean | mixed | null | void

get_key() публичный статический Метод

Get the cache key, salted with current Pods version, peppered with md5 if too long
С версии: 2.6.2
public static get_key ( string $key, string $group_key = '' ) : string
$key string
$group_key string
Результат string

get_template_part() публичный статический Метод

public static get_template_part ( $_view, null | array $_data = null ) : boolean | mixed | string | void
$_view
$_data null | array
Результат boolean | mixed | string | void

set() публичный статический Метод

С версии: 2.0
public static set ( string $key, mixed $value, integer $expires, string $cache_mode = null, string $group = '' ) : boolean | mixed | null | string | void
$key string Key for the cache
$value mixed Value to add to the cache
$expires integer (optional) Time in seconds for the cache to expire, if 0 no expiration.
$cache_mode string (optional) Decides the caching method to use for the view.
$group string (optional) Set the group of the value.
Результат boolean | mixed | null | string | void

view() публичный статический Метод

С версии: 2.0
public static view ( string $view, array | null $data = null, boolean | integer | array $expires = false, string $cache_mode = 'cache' ) : boolean | mixed | null | string | void
$view string Path of the view file
$data array | null (optional) Data to pass on to the template
$expires boolean | integer | array (optional) Time in seconds for the cache to expire, if 0 no expiration.
$cache_mode string (optional) Decides the caching method to use for the view.
Результат boolean | mixed | null | string | void

Описание свойств

$cache_modes статическое публичное свойство

Array of available cache modes
static public array $cache_modes
Результат array