English 中文(简体)
Symfony2:调试控制器变量
原标题:Symfony2: debug controller variables

我如何快速获取和查看控制器中使用的变量? 我使用 xdebug, 但通常在通过控制器时看到一个对象的内涵是太小了 。

最佳回答

您可以使用 < a href=> http://php.net/manual/en/formation.get- defed-vars.php" rel=“ norefererr” >get_ defed_vars () 方法, 并使用 monolog 库(例如) 登录当前范围定义的变量。

    $this->container->get( logger )->info( Local variables , get_defined_vars());

我建议在Firefox中安装>>FirePHP 扩展号,因为在dev 模式下, FirePHP 处理器自动启用,以便您可以在火虫控制台中看到信息。关于登机检查的更多信息,请参见http://symfony.com/doc/proc/current/cookbook/loging/monolog.html> rel=“noreferr” > this cookbook条目。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签