- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我最近将一切正常的 Silex v1.3 项目迁移到了 Silex v2。我收到一个 Twig 错误,我不明白原因
Twig_Error_Runtime in Template.php line 590:
Neither the property "request" nor one of the methods "request()", "getrequest()"/"isrequest()" or "__call()" exist and have public access in class "Silex\Application" in "index.twig" at line 5
这是我的 index.twig 文件的前 5 行
{% extends "layout.twig" %}
{% block stylsheets %}
<link rel="stylesheet" type="text/css" href="{{ app.request.basepath }}/public/libs/odometer/themes/odometer-theme-minimal.css" />
当然在布局中,我调用
{% block stylsheets %}{% endblock %}
但我完全不确定,问题出在 Twig 文件上......有什么需要改变的吗?
这是 Controller 的摘录:
$app->get('/', function () use ($app) {
return $app['twig']->render('index.twig', [
...
]);
})->bind('homepage');
感谢帮助
最佳答案
我发现 app.request.uri
不再适用于最近的 Twig。
但是如果你使用 global.request.uri
它工作正常。
我没有在 Twig 的文档中找到任何相关信息。
关于php - Silex v1.3 到 Silex v2 : Twig_Error_Runtime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38490126/
我继承了一个零文档的 Symfony/PHP 网络应用程序代码库。我是一名 nodejs 开发人员,因此您可以想象其中的乐趣......!无论如何,我要做到这一点,我的重点是能够在本地运行该项目。 这
将 Twig 更新为 > 1.7 后 代码 原因: Twig_Error_Runtime: An exception has been thrown during the compilation of
自从几天前(2015 年 11 月 30 日)发布了最新的 Symfony LTS 版本后,我就开始使用它了。不幸的是,我无法使用在 Symfony 2.7.7 中运行良好的相同代码生成具有写入操作的
我最近将一切正常的 Silex v1.3 项目迁移到了 Silex v2。我收到一个 Twig 错误,我不明白原因 Twig_Error_Runtime in Template.php line 59
尝试在 Symfony 2.1 中打开路由时出现此错误 我真的不知道去哪里检查。互联网上什么都没有。 非常感谢您的帮助: CRITICAL - Uncaught PHP Exception Twig_
我的 symfony 项目中有这个实体: /** * Batiments * * @ORM\Table(name="batiments") * @ORM\Entity * @ORM\Enti
我是一名优秀的程序员,十分优秀!