Skip to content
This repository was archived by the owner on Jan 2, 2024. It is now read-only.

Commit f218cc7

Browse files
committed
Update README.md
1 parent 2120626 commit f218cc7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,22 @@ There is no configuration needed unless you want to [customize the Blade views a
7373

7474
## Usage
7575

76+
### Preface
77+
78+
Generating HTML in PHP is always quite opinionated and limited. Blade Components are great because additional attributes are passed down to the element. That's why we prefer writing forms using components instead of using PHP builders. This way, you don't have to write extensions or custom code for any attribute you pass in. Let's take a look at this `x-form` example.
79+
80+
```blade
81+
<x-form action="/api/user">
82+
<!-- ... -->
83+
</x-form>
84+
```
85+
86+
```blade
87+
<x-form :action="route('api.user.store')" v-on:submit="checkForm">
88+
<!-- ... -->
89+
</x-form>
90+
```
91+
7692
### Input and textarea elements
7793

7894
The minimum requirement for an `input` or `textarea` is the `name` attribute.

0 commit comments

Comments
 (0)