add doc for crud inline_form
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
dd6e9c90bc
commit
08e1965930
|
@ -111,7 +111,6 @@ All fields have these options:
|
||||||
| `inline_form` | `null|callable` | `null` | A method to define a form to edit datas |
|
| `inline_form` | `null|callable` | `null` | A method to define a form to edit datas |
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
```php-inline Example #0
|
```php-inline Example #0
|
||||||
$configuration->setField('index', 'My field', TextField::class, [
|
$configuration->setField('index', 'My field', TextField::class, [
|
||||||
'property' => 'myProperty',
|
'property' => 'myProperty',
|
||||||
|
@ -120,6 +119,7 @@ $configuration->setField('index', 'My field', TextField::class, [
|
||||||
return $entity->getMyProperty();
|
return $entity->getMyProperty();
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
```
|
||||||
|
|
||||||
```php-inline Example #1
|
```php-inline Example #1
|
||||||
$configuration->setField('index', 'My field', TextField::class, [
|
$configuration->setField('index', 'My field', TextField::class, [
|
||||||
|
@ -128,6 +128,7 @@ $configuration->setField('index', 'My field', TextField::class, [
|
||||||
return sprintf('<span class="foo">%s</span>', $entity->getBar());
|
return sprintf('<span class="foo">%s</span>', $entity->getBar());
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
```
|
||||||
|
|
||||||
```php-inline Example #2
|
```php-inline Example #2
|
||||||
// https://127.0.0.7:8000/admin/my_entity?_sort=property&_sort_direction=asc
|
// https://127.0.0.7:8000/admin/my_entity?_sort=property&_sort_direction=asc
|
||||||
|
@ -139,6 +140,7 @@ $configuration->setField('index', 'My field', TextField::class, [
|
||||||
$query->orderBy('.myProperty', $direction);
|
$query->orderBy('.myProperty', $direction);
|
||||||
}],
|
}],
|
||||||
])
|
])
|
||||||
|
```
|
||||||
|
|
||||||
```php-inline Example #3
|
```php-inline Example #3
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
Loading…
Reference in a new issue