progest/twig-extension-callfunc
最新稳定版本:1.2
Composer 安装命令:
composer require progest/twig-extension-callfunc
包简介
Twig extension to call PHP functions or static methods from templates
README 文档
README
Twig extension to call PHP functions or static methods from templates
Installation:
# $twig being your Twig_Environment object $twig->addExtension(new \ProGest\Twig\CallFuncExtension());
Usage:
# Call function
{{ callfunc('myFunction') }}
# Call static method
{{ callfunc('myClass::myStaticMethod') }}
# Pass one or multiple arguments
{{ callfunc('myFunction', 8546) }}
{{ callfunc('myFunction', ['testValue', 9897]) }}
统计信息
- 总下载量: 1.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-02