graciano / blade-helpers
为 Laravel Blade 模板输入提供辅助工具。
v1.1.0
2016-06-07 19:23 UTC
Requires
- php: >=5.5.9
- illuminate/support: ~5.2
This package is not auto-updated.
Last update: 2024-09-14 18:52:52 UTC
README
为 laravel blade 模板输入提供辅助工具。在 laravel 5.2、5.3 和 5.4 中进行了测试
使用方法
<input type="text" name='name' value="{{ input_value($obj, 'name') }}" /> <!-- this will call $obj->{name} for the value, if none is found (or the obj is null), old('name') will be displayed -->
或者,如果你有一个复选框
<input type="checlbox" name='accept' {{ input_checked($obj, 'accepted') }} /> <!-- this will print checked if the obj->accepted (or the old input) is anything but false/null -->
安装
首先,使用 composer 需求项目: $ composer require graciano/blade-helpers
在 composer.json 文件的 sections 部分添加文件,如下所示
"autoload": { "files":[ "vendor/graciano/blade-helpers/src/helpers.php" ], }
然后,执行 composer dumpautoload
许可证
本项目是开源软件,遵循 MIT 许可证