vesperabr/laravel-data-binder
Composer 安装命令:
composer require vesperabr/laravel-data-binder
包简介
Bind and retrieve input data
README 文档
README
The vesperabr/laravel-data-binder package provides an easy whay to bind and retrieve input data.
Installation
You can install the package via composer:
$ composer require vesperabr/laravel-data-binder
The package will automatically register itself.
Binding values
You can append values to the binding tree by two ways:
Using bind() method
use Vespera\DataBinder\Support\Facades\DataBinder; DataBinder::bind(['foo' => 'bar'])
Using blade directives
@bind(['foo' => 'bar']) ... @endbind
Pop data from binding
To remove the last data from binding tree just call pop() method.
use Vespera\DataBinder\Support\FacadesDataBinder; DataBinder::pop();
Retrieving values from binding
To retrieve a value from binding tree use the DataValue facade.
use Vespera\DataBinder\Support\Facades\DataValue; DataValue::get('foo');
You can also override the current bind data passing a second parameter.
$user = User::find(1); DataValue::get('name', $user);
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 155
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-14