有没有办法找到我安装的Twig版本?
就像是
<p>The current version is {% twig.version %}</p>
Run Code Online (Sandbox Code Playgroud)
(虽然我知道它甚至不是正确的).
小智 31
试试吧:
<p>The current version is {{ constant('Twig_Environment::VERSION') }}</p>
Run Code Online (Sandbox Code Playgroud)
crm*_*cco 15
你会发现它 vendor/twig/twig/lib/Twig/Environment.php
/**
* Stores the Twig configuration.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_Environment
{
const VERSION = '1.24.0';
Run Code Online (Sandbox Code Playgroud)
小智 6
对于 Twig 3,你需要使用类似的东西
`Twig version is {{ constant('\Twig\\Environment::VERSION') }}.`
Run Code Online (Sandbox Code Playgroud)
在你的模板里面。
| 归档时间: |
|
| 查看次数: |
8973 次 |
| 最近记录: |