Skip to content

Commit e75c352

Browse files
committed
fix form component docs
1 parent ba2ff25 commit e75c352

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

7.x/base-components.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ This component helps you show a form _anywhere you want_, so the admin can easil
9797
```
9898

9999
**Configuration options:**
100-
- `operation='create'` - by default, the datatable component will pick up everything that controller sets up for the Create operation; if you want to change the operation it will initialize, you can pass this parameter;
100+
- `form-operation='create'` - by default, the datatable component will pick up everything that controller sets up for the Create operation; if you want to change the operation it will initialize, you can pass this parameter;
101101
- `:entry="\App\Models\Invoice::find(1)"` - if you want to use UpdateOperation or a custom form operation that needs the entry;
102102
- `:setup="function($crud, $parent) {}"` - if you want to make changes to the operation setup (eg. add/remove fields, configure functionality), you can use this parameter; the closure passed here will be run _after_ the setup of that operation had already completed;
103103
- `:save-actions="[]"` - provide an array of save action definitions or save action classes to replace the defaults (see [Custom save actions](#dataform-custom-save-actions));
@@ -109,7 +109,7 @@ This component helps you show a form _anywhere you want_, so the admin can easil
109109
<x-bp-dataform
110110
controller="\App\Http\Controllers\Admin\InvoiceCrudController"
111111
name="invoice_form"
112-
operation="update"
112+
form-operation="update"
113113
:entry="\App\Models\Invoice::find(1)"
114114
:setup="function($crud, $parent) {
115115
$crud->removeColumn('notes');
@@ -166,18 +166,19 @@ use \Backpack\DataformModal\Http\Controllers\Operations\CreateInModalOperation;
166166
```
167167

168168
**Configuration options:**
169-
- `operation='createInModal'` - by default, the component will pick up everything that controller sets up for the Create operation; if you want to change the operation it will initialize, you can pass this parameter, eg: `updateInModal`
169+
- `form-operation='createInModal'` - by default, the component will pick up everything that controller sets up for the Create operation; if you want to change the operation it will initialize, you can pass this parameter, eg: `updateInModal`
170170
- `:entry="\App\Models\Invoice::find(1)"` - if you want to use UpdateInModalOperation or a custom form operation that needs the entry;
171171
- `:setup="function($crud, $parent) {}"` - if you want to make changes to the operation setup (eg. add/remove fields, configure functionality), you can use this parameter; the closure passed here will be run _after_ the setup of that operation had already completed;
172172
- `:save-actions="[]"` - replace the default modal buttons with your own save action classes.
173+
- `:form-inside-card="true"` - render the form inside a Backpack card wrapper so it visually matches the default create/update screens; leave it `false` to output only the raw form markup.
173174

174175
**Advanced example:**
175176

176177
```html
177178
<x-bp-dataform-modal
178179
controller="\App\Http\Controllers\Admin\InvoiceCrudController"
179180
name="invoice_form"
180-
operation="updateInModal"
181+
form-operation="updateInModal"
181182
:entry="\App\Models\Invoice::find(1)"
182183
:setup="function($crud, $parent) {
183184
$crud->removeColumn('notes');
@@ -201,17 +202,18 @@ Useful if you want to show the entries in the database, for an Eloquent model. T
201202

202203
**Configuration options:**
203204
- `name='invoices_datatable'` - by default, a name will be generated; but you can pick one you can recognize;
204-
- `operation='list'` - by default, the datatable component will pick up everything that controller sets up for the List operation; if you want to change the operation it will initialize, you can pass this parameter;
205+
- `form-operation='list'` - by default, the datatable component will pick up everything that controller sets up for the List operation; if you want to change the operation it will initialize, you can pass this parameter;
205206
- `:useFixedHeader="false"` - set this to explicitly enable or disable the sticky header; it defaults to the operation's `useFixedHeader` setting, falling back to `true`;
206207
- `:setup="function($crud, $parent) {}"` - if you want to make changes to the operation setup (eg. add/remove columns, configure functionality), you can use this parameter; the closure passed here will be run _after_ the setup of that operation had already completed;
208+
- `:form-inside-card="true"` - render the form inside a Backpack card wrapper so it visually matches the default create/update screens; leave it `false` to output only the raw form markup.
207209

208210
**Advanced example:**
209211

210212
```html
211213
<x-bp-datatable
212214
controller="\App\Http\Controllers\Admin\InvoiceCrudController"
213215
name="invoices"
214-
operation="show"
216+
form-operation="show"
215217
:setup="function($crud, $parent) {
216218
if ($parent) {
217219
$crud->addClause('where', 'customer_id', $parent->id);

0 commit comments

Comments
 (0)