spaf/yii2-simputils
Composer 安装命令:
composer require spaf/yii2-simputils
包简介
Yii2 extension wrap for php-simputils, some useful wraps that improve usage
README 文档
README
Yii2 extension wrap for php-simputils, some useful wraps that improve usage
Current condition
This version is initial wrapper-library for usage with Yii2 framework.
Basically it implements just an improvement of VarDumper capabilities for "pd()" procedure. All other functionality will be added later.
P.S. This version I have developed just for myself. Because my php-simputils is not ready as well. But you are welcome to suggest things/functionality for both. Documentation will be improved as well.
Basic Usage
Install it through composer:
composer require spaf/yii2-simputils "*"
Add this to your yii2 config file for console.php:
<?php $config = [ // ... 'bootstrap' => [ [ 'class' => 'spaf\yii\simputils\bootstrap\SimputilsBootstrap', 'isConsole' => true, ] ], // ... ];
And add this one for web.php:
<?php $config = [ // ... 'bootstrap' => [ [ 'class' => 'spaf\yii\simputils\bootstrap\SimputilsBootstrap', ] ], // ... ];
And that's it! Now you can use the wrapped functionality (currently only pd() procedure).
In your code you can use now:
<?php use function spaf\simputils\basic\pd; $myVar = [ 'key1' => 'value1', 'key2' => [ 'subkey1' => 'subvalue1', 'subkey2' => 12 ], ]; pd($myVar);
Important: You need to use normal pd() procedure, this library does not redefine it, but adjust it's behaviour.
统计信息
- 总下载量: 125
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-18