twig\ViewRenderer $functions

$functions public property

Custom functions. Keys of the array are names to call in template, values are names of functions or static methods of some class. Example: ['rot13' => 'str_rot13', 'a' => '\yii\helpers\Html::a']. In the template you can use it like this: {{ rot13('test') }} or {{ a('Login', 'site/login') | raw }}.

public array $functions = []
doc_Yii
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.