PHP 클래스 Timber\Timber

Main class called Timber for this plugin.
파일 보기 프로젝트 열기: jarednova/timber 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$auto_meta
$autoescape
$cache
$context_cache
$dirname
$locations
$twig_cache
$version

공개 메소드들

메소드 설명
__construct ( )
add_route ( string $route, callable $callback, array $args = [] ) Add route.
compile ( array $filenames, array $data = [], boolean | integer $expires = false, string $cache_mode = Loader::CACHE_USE_DEFAULT, boolean $via_render = false ) : boolean | string Compile function.
compile_string ( string $string, array $data = [] ) : boolean | string Compile string.
fetch ( array $filenames, array $data = [], boolean $expires = false, string $cache_mode = Loader::CACHE_USE_DEFAULT ) : boolean | string Fetch function.
get_context ( ) : array Get context.
get_pagination ( array $prefs = [] ) : array Get pagination.
get_post ( mixed $query = false, string | array $PostClass = 'Timber\Post' ) : array | boolean | null Get post.
get_posts ( mixed $query = false, string | array $PostClass = 'Timber\Post', $return_collection = false ) : array | boolean | null Get posts.
get_sidebar ( string $sidebar = 'sidebar.php', array $data = [] ) : boolean | string Get sidebar.
get_sidebar_from_php ( string $sidebar = '', array $data ) : string Get sidebar from PHP
get_sites ( array | boolean $blog_ids = false ) : array Get sites.
get_term ( integer | WP_Term | object $term, string $taxonomy = 'post_tag', $TermClass = 'Timber\Term' ) : Timber\Term | WP_Error | null Get term.
get_terms ( string | array $args = null, array $maybe_args = [], string $TermClass = 'Timber\Term' ) : mixed Get terms.
get_widgets ( integer $widget_id ) : TimberFunctionWrapper Get widgets.
init_constants ( )
query_post ( mixed $query = false, string $PostClass = 'Timber\Post' ) : array | boolean | null Query post.
query_posts ( mixed $query = false, string $PostClass = 'Timber\Post' ) : PostCollection Query posts.
render ( array $filenames, array $data = [], boolean | integer $expires = false, string $cache_mode = Loader::CACHE_USE_DEFAULT ) : boolean | string Render function.
render_string ( string $string, array $data = [] ) : boolean | string Render string.

보호된 메소드들

메소드 설명
init ( )
test_compatibility ( ) Tests whether we can use Timber

비공개 메소드들

메소드 설명
backwards_compatibility ( )

메소드 상세

__construct() 공개 메소드

public __construct ( )

add_route() 공개 정적인 메소드

Add route.
사용 중단: since 0.20.0 and will be removed in 1.1
public static add_route ( string $route, callable $callback, array $args = [] )
$route string
$callback callable
$args array

compile() 공개 정적인 메소드

Compile function.
public static compile ( array $filenames, array $data = [], boolean | integer $expires = false, string $cache_mode = Loader::CACHE_USE_DEFAULT, boolean $via_render = false ) : boolean | string
$filenames array
$data array
$expires boolean | integer
$cache_mode string
$via_render boolean
리턴 boolean | string

compile_string() 공개 정적인 메소드

Compile string.
public static compile_string ( string $string, array $data = [] ) : boolean | string
$string string a string with twig variables.
$data array an array with data in it.
리턴 boolean | string

fetch() 공개 정적인 메소드

Fetch function.
public static fetch ( array $filenames, array $data = [], boolean $expires = false, string $cache_mode = Loader::CACHE_USE_DEFAULT ) : boolean | string
$filenames array
$data array
$expires boolean
$cache_mode string
리턴 boolean | string

get_context() 공개 정적인 메소드

Get context.
public static get_context ( ) : array
리턴 array

get_pagination() 공개 정적인 메소드

Get pagination.
public static get_pagination ( array $prefs = [] ) : array
$prefs array
리턴 array mixed

get_post() 공개 정적인 메소드

Get post.
public static get_post ( mixed $query = false, string | array $PostClass = 'Timber\Post' ) : array | boolean | null
$query mixed
$PostClass string | array
리턴 array | boolean | null

get_posts() 공개 정적인 메소드

Get posts.
public static get_posts ( mixed $query = false, string | array $PostClass = 'Timber\Post', $return_collection = false ) : array | boolean | null
$query mixed
$PostClass string | array
리턴 array | boolean | null

get_sidebar() 공개 정적인 메소드

Get sidebar.
public static get_sidebar ( string $sidebar = 'sidebar.php', array $data = [] ) : boolean | string
$sidebar string
$data array
리턴 boolean | string

get_sidebar_from_php() 공개 정적인 메소드

Get sidebar from PHP
public static get_sidebar_from_php ( string $sidebar = '', array $data ) : string
$sidebar string
$data array
리턴 string

get_sites() 공개 정적인 메소드

Get sites.
public static get_sites ( array | boolean $blog_ids = false ) : array
$blog_ids array | boolean
리턴 array

get_term() 공개 정적인 메소드

Get term.
public static get_term ( integer | WP_Term | object $term, string $taxonomy = 'post_tag', $TermClass = 'Timber\Term' ) : Timber\Term | WP_Error | null
$term integer | WP_Term | object
$taxonomy string
리턴 Timber\Term | WP_Error | null

get_terms() 공개 정적인 메소드

Get terms.
public static get_terms ( string | array $args = null, array $maybe_args = [], string $TermClass = 'Timber\Term' ) : mixed
$args string | array
$maybe_args array
$TermClass string
리턴 mixed

get_widgets() 공개 정적인 메소드

Get widgets.
public static get_widgets ( integer $widget_id ) : TimberFunctionWrapper
$widget_id integer
리턴 TimberFunctionWrapper

init() 보호된 정적인 메소드

protected static init ( )

init_constants() 공개 메소드

public init_constants ( )

query_post() 공개 정적인 메소드

Query post.
public static query_post ( mixed $query = false, string $PostClass = 'Timber\Post' ) : array | boolean | null
$query mixed
$PostClass string
리턴 array | boolean | null

query_posts() 공개 정적인 메소드

Query posts.
public static query_posts ( mixed $query = false, string $PostClass = 'Timber\Post' ) : PostCollection
$query mixed
$PostClass string
리턴 PostCollection

render() 공개 정적인 메소드

Render function.
public static render ( array $filenames, array $data = [], boolean | integer $expires = false, string $cache_mode = Loader::CACHE_USE_DEFAULT ) : boolean | string
$filenames array
$data array
$expires boolean | integer
$cache_mode string
리턴 boolean | string

render_string() 공개 정적인 메소드

Render string.
public static render_string ( string $string, array $data = [] ) : boolean | string
$string string a string with twig variables.
$data array an array with data in it.
리턴 boolean | string

test_compatibility() 보호된 메소드

Tests whether we can use Timber
protected test_compatibility ( )

프로퍼티 상세

$auto_meta 공개적으로 정적으로 프로퍼티

public static $auto_meta

$autoescape 공개적으로 정적으로 프로퍼티

public static $autoescape

$cache 공개적으로 정적으로 프로퍼티

public static $cache

$context_cache 공개적으로 정적으로 프로퍼티

public static $context_cache

$dirname 공개적으로 정적으로 프로퍼티

public static $dirname

$locations 공개적으로 정적으로 프로퍼티

public static $locations

$twig_cache 공개적으로 정적으로 프로퍼티

public static $twig_cache

$version 공개적으로 정적으로 프로퍼티

public static $version