PHP Class PodsView, pods

Mostrar archivo Open project: pods-framework/pods Class Usage Examples

Public Properties

Property Type Description
$cache_modes array Array of available cache modes

Public Methods

Method Description
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

Private Methods

Method Description
__construct ( ) : PodsView
locate_template ( $_view ) : boolean | mixed | string | void

Method Details

clear() public static method

Since: 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.
return boolean

expires() public static method

Advanced $expires handling
Since: 3.0
public static expires ( array | boolean | integer $expires, string $cache_mode = 'cache' ) : boolean | integer
$expires array | boolean | integer
$cache_mode string
return boolean | integer

get() public static method

Since: 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.
return boolean | mixed | null | void

get_key() public static method

Get the cache key, salted with current Pods version, peppered with md5 if too long
Since: 2.6.2
public static get_key ( string $key, string $group_key = '' ) : string
$key string
$group_key string
return string

get_template_part() public static method

public static get_template_part ( $_view, null | array $_data = null ) : boolean | mixed | string | void
$_view
$_data null | array
return boolean | mixed | string | void

set() public static method

Since: 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.
return boolean | mixed | null | string | void

view() public static method

Since: 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.
return boolean | mixed | null | string | void

Property Details

$cache_modes static_oe public_oe property

Array of available cache modes
static public array $cache_modes
return array