PHP 클래스 yii\twig\Extension

저자: Andrey Grachov ([email protected])
저자: Alexander Makarov ([email protected])
상속: extends Twig_Extension
파일 보기 프로젝트 열기: yiisoft/yii2-twig

보호된 프로퍼티들

프로퍼티 타입 설명
$aliases used class aliases
$namespaces used namespaces
$widgets used widgets

공개 메소드들

메소드 설명
__construct ( array $uses = [] ) Creates new instance
addUses ( array $args ) Adds namespaces and aliases from constructor
beginWidget ( string $widget, array $config = [] ) : mixed Function for *_begin syntax support
call ( string $className, string $method, array $arguments = null ) : mixed Calls a method
endWidget ( string $widget = null ) Function for *_end syntax support
getFunctions ( )
getName ( )
getNodeVisitors ( )
path ( string $path, array $args = [] ) : string Generates relative URL
registerAsset ( array $context, string $asset ) : mixed Function for registering an asset
registerAssetBundle ( array $context, string $bundle, boolean $return = false ) : void | AssetBundle Function for additional syntax of registering asset bundles
resolveAndCall ( string $className, string $method, array $arguments = null ) : mixed Resolves a method from widget and asset syntax and calls it
resolveClassName ( string $className ) : string Resolves class name from widget and asset syntax
setProperty ( stdClass $object, string $property, mixed $value ) Sets object property
url ( string $path, array $args = [] ) : string Generates absolute URL
viewHelper ( array $context, string $name = null ) Used for 'begin_page', 'end_page', 'begin_body', 'end_body', 'head'
widget ( string $widget, array $config = [] ) : mixed Function for *_widget syntax support

메소드 상세

__construct() 공개 메소드

Creates new instance
public __construct ( array $uses = [] )
$uses array namespaces and classes to use in the template

addUses() 공개 메소드

Adds namespaces and aliases from constructor
public addUses ( array $args )
$args array namespaces and classes to use in the template

beginWidget() 공개 메소드

Function for *_begin syntax support
public beginWidget ( string $widget, array $config = [] ) : mixed
$widget string widget name
$config array widget config
리턴 mixed

call() 공개 메소드

Calls a method
public call ( string $className, string $method, array $arguments = null ) : mixed
$className string class name
$method string method name
$arguments array
리턴 mixed

endWidget() 공개 메소드

Function for *_end syntax support
public endWidget ( string $widget = null )
$widget string widget name

getFunctions() 공개 메소드

public getFunctions ( )

getName() 공개 메소드

public getName ( )

getNodeVisitors() 공개 메소드

public getNodeVisitors ( )

path() 공개 메소드

Generates relative URL
public path ( string $path, array $args = [] ) : string
$path string the parameter to be used to generate a valid URL
$args array arguments
리턴 string the generated relative URL

registerAsset() 공개 메소드

{{ use('yii/web/JqueryAsset') }} {{ register_jquery_asset() }}
public registerAsset ( array $context, string $asset ) : mixed
$context array context information
$asset string asset name
리턴 mixed

registerAssetBundle() 공개 메소드

{{ register_asset_bundle('yii/web/JqueryAsset') }}
부터: 2.0.4
public registerAssetBundle ( array $context, string $bundle, boolean $return = false ) : void | AssetBundle
$context array context information
$bundle string asset bundle class fully qualified name
$return boolean indicates if AssetBundle should be returned
리턴 void | yii\web\AssetBundle

resolveAndCall() 공개 메소드

Resolves a method from widget and asset syntax and calls it
public resolveAndCall ( string $className, string $method, array $arguments = null ) : mixed
$className string class name
$method string method name
$arguments array
리턴 mixed

resolveClassName() 공개 메소드

Resolves class name from widget and asset syntax
public resolveClassName ( string $className ) : string
$className string class name
리턴 string

setProperty() 공개 메소드

Sets object property
public setProperty ( stdClass $object, string $property, mixed $value )
$object stdClass
$property string
$value mixed

url() 공개 메소드

Generates absolute URL
public url ( string $path, array $args = [] ) : string
$path string the parameter to be used to generate a valid URL
$args array arguments
리턴 string the generated absolute URL

viewHelper() 공개 메소드

Used for 'begin_page', 'end_page', 'begin_body', 'end_body', 'head'
public viewHelper ( array $context, string $name = null )
$context array context information
$name string

widget() 공개 메소드

Function for *_widget syntax support
public widget ( string $widget, array $config = [] ) : mixed
$widget string widget name
$config array widget config
리턴 mixed

프로퍼티 상세

$aliases 보호되어 있는 프로퍼티

used class aliases
protected $aliases

$namespaces 보호되어 있는 프로퍼티

used namespaces
protected $namespaces

$widgets 보호되어 있는 프로퍼티

used widgets
protected $widgets