frizzy / slim-twig-extension
Slim 框架的 Twig 扩展
This package is not auto-updated.
Last update: 2024-09-24 00:50:10 UTC
README
用法
将以下内容添加到您的根 composer.json 文件中
{
"require": {
"frizzy/slim-twig-extension": "0.1.*"
}
}
将扩展添加到您的 Twig 环境中
<?php
$twig = new \Twig_Environment(new \Twig_Loader_Filesystem(...));
$twig->addExtension(new \Frizzy\Slim\Twig\Extension);
?>
Twig 中可用的函数
- render_route_name
- render_route_path
- render_template
- path
- url