add doc for crud inline_form
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-04-14 06:55:20 +02:00
parent dd6e9c90bc
commit 08e1965930
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -111,7 +111,6 @@ All fields have these options:
| `inline_form` | `null|callable` | `null` | A method to define a form to edit datas |
```
```php-inline Example #0
$configuration->setField('index', 'My field', TextField::class, [
'property' => 'myProperty',
@ -120,6 +119,7 @@ $configuration->setField('index', 'My field', TextField::class, [
return $entity->getMyProperty();
},
])
```
```php-inline Example #1
$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());
},
])
```
```php-inline Example #2
// 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);
}],
])
```
```php-inline Example #3
use Symfony\Component\Form\FormBuilderInterface;