anourvalar / laravel-form
Laravel blade 组件,用于 HTML 表单元素(输入 / 选择 / 文本区域)
1.5.11
2024-08-13 17:03 UTC
Requires
- php: ^8.0
- anourvalar/config-helper: ^3.3
- laravel/framework: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.26
- orchestra/testbench: ^8.6
- phpstan/phpstan: ^1.10
- psalm/plugin-laravel: ^2.8
- squizlabs/php_codesniffer: ^3.7
README
安装
composer require anourvalar/laravel-form
功能
-
在验证失败时替换旧值;
-
为无效元素添加错误类。
用法
输入
<x-input type="text" name="foo" value="some text" />
<x-input type="checkbox" name="foo" value="1" :checked="$isChecked" />
<x-input type="radio" name="foo" value="1" checked-value="2" /> <x-input type="radio" name="foo" value="2" checked-value="2" /> <!-- will be checked --> <x-input type="radio" name="foo" value="3" checked-value="2" />
选择
<x-select name="foo" :options="[1 => ['title' => 'One'], 2 => ['title' => 'Two']]" selected="2" />
文本区域
<x-textarea name="foo">Text</x-textarea>