我試圖從遠程計算機做到這一點,因此app_dev.php是:模板呈現無法獲得的Symfony 2工具欄上顯示網站
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
Debug::enable();
require_once __DIR__.'/../app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
後,我得到這個:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title</title>
</head>
<body>
<h1>Give us a toolbar now will you?</h1>
</body>
</html>
看起來像有效的html,並有一個body元素,但沒有工具欄。
我只有ftp訪問權限,因此將Symfony/app/cache文件夾重命名爲不存在。
我已經證實,app_dev.php執行Debug::enable();
和$kernel = new AppKernel('dev', true);
(添加有引起的誤差的誤差。
我已經證實,有效的HTML產生渲染index.html.twig(不是高速緩存的一個)。我已更名爲緩存目錄。
不知道還有什麼可以檢查有它顯示的工具欄。
謝謝你的回覆,AppKernel看起來像你發佈的那個,WebProfilerBundle在Symfony中,因此是senseo中的DistributionBundle和GeneratorBundle。 JavaScript已啓用,但您可以在生成的響應中看到它並不重要,因爲沒有生成工具欄,即使JavaScript被禁用,工具欄也會顯示在頁面源中。 – HMR
必須啓用Javascript,因爲工具欄是通過javascript加載的。但即使JavaScript被禁用,您仍然正確WebProfilerBundle在