简体   繁体   English

Laravel dd()相当于Cake PHP

[英]Laravel dd() equivalent for Cake PHP

I would like to know if there is an equivalent method to laravel method dd() for Cake PHP. 我想知道是否有一个与Cake PHP的laravel方法dd()等效的方法。 If you don't know, dd() dump the given variable and end execution of the script. 如果你不知道,dd()转储给定的变量并结束脚本的执行。

Thanks you. 谢谢。

Try adding a prd() function into bootstrap.php 尝试在bootstrap.php中添加prd()函数

function prd($var)
{
    pr($var);
    die;
}

source: http://debuggable.com/posts/make-your-life-easier-with-these-five-cakephp-quicktips:48170ee5-0cc0-4815-af60-7c264834cda3 来源: http//debuggable.com/posts/make-your-life-easier-with-these-five-cakephp-quicktips : 48170ee5-0cc0-4815-af60-7c264834cda3

You could also add it to cakephp/app/Config/helpers.php 您也可以将它添加到cakephp / app / Config / helpers.php

https://github.com/larapack/dd https://github.com/larapack/dd

Very straightforward to install via Composer. 通过Composer安装非常简单。

Jus use dump($var); Jus使用dump($ var);

After that you can stop the execution with exit; 之后,您可以通过退出停止执行;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM