PHP Класс yii\twig\Extension

Автор: Andrey Grachov ([email protected])
Автор: Alexander Makarov ([email protected])
Наследование: extends Twig_Extension
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$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