library var-dumper
基于symfony/var-dumper输出助手函数
wangningkai/var-dumper
基于symfony/var-dumper输出助手函数
- Thursday, August 2, 2018
- by WangNingkai
- Repository
- 1 Watchers
- 0 Stars
- 8 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
VarDumper组件
, (*1)
安装方法 :
composer require wangningkai/var-dumper
使用方法:
可以参考目录下的 heplers/functions.php
内容, (*2)
<?php
use WangNingkai\VarDumper\Dumper;
if (! function_exists('dd')) {
/**
* Dump the passed variables and end the script.
*
* @param mixed
* @return void
*/
function dd($args)
{
foreach ($args as $var) {
(new Dumper)->dump($var);
}
die(1);
}
}
if (! function_exists('dda')) {
/**
* Dump the passed array variables and end the script.
*
* @param mixed
* @return void
*/
function dda($args)
{
foreach ($args as $var) {
(new Dumper)->dump($var->toArray());
}
die(1);
}
}
将其加入到项目的全局函数中去
在其他文件中可以参考下面
<?php
require __DIR__.'/vendor/autoload.php';
$var = array(
'a simple string' => 'in an array of 5 elements',
'a float' => 1.0,
'an integer' => 1,
'a boolean' => true,
'an empty array' => array(),
);
dd($var);
dev-master
9999999-dev
基于symfony/var-dumper输出助手函数
Sources
Download
MIT
The Requires
by
WangNingkai
debug
var_dump
v1.0
1.0.0.0
基于symfony/var-dumper输出助手函数
Sources
Download
MIT
The Requires
by
WangNingkai
debug
var_dump