问题描述
我使用Symfony2(常量版本="2.5.10")并在PHP 5.5.19中使用xampp.
Im using Symfony2 (const version="2.5.10") and using xampp with PHP version 5.5.19.
我遇到一个问题,即在我的开发环境中没有显示探查器.这可能是什么问题?
I got a problem that in my dev environment the profiler didn't show up.What could be the problem?
config.yml
config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
#esi: ~
#translator: { fallback: "%locale%" }
translator: ~
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: ~
http_method_override: true
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
# Assetic Configuration
assetic:
debug: "%kernel.debug%"
use_controller: false
bundles: ['MatrixEdiBundle', 'FOSUserBundle']
#java: /usr/bin/java
filters:
cssrewrite: ~
#closure:
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
#yui_css:
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
# Doctrine Configuration
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver, add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: Matrix\MatrixUserBundle\Entity\User
config_dev.yml
config_dev.yml
imports:
- { resource: config.yml }
framework:
router:
resource: "%kernel.root_dir%/config/routing_dev.yml"
strict_requirements: true
profiler: { only_exceptions: false }
web_profiler:
toolbar: %debug_toolbar%
intercept_redirects: %debug_redirects%
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
bubble: false
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
assetic:
use_controller: %use_assetic_controller%
swiftmailer:
#delivery_address: [email protected]
disable_delivery: false
推荐答案
分析器工具栏需要<body> ... </body>
.我想您的树枝文件中没有该文件.
The profiler toolbar needs <body> ... </body>
. I guess you don't have it in your twig file(s).
# app/config/config_dev.yml
web_profiler:
toolbar: true
intercept_redirects: false
树枝文件示例.
{% extends '::base.html.twig' %}
行将扩展app/Resources/views/base.html.twig
,这会将默认<body>...</body>
注入到您的自定义树枝文件中.
The line {% extends '::base.html.twig' %}
will extend app/Resources/views/base.html.twig
which injects default <body>...</body>
into your custom twig files.
{% extends '::base.html.twig' %}
{% block body %}
Hello!
{% endblock %}
这篇关于Web Profiler未显示在开发人员中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!