Skip to content

Commit 3c1f385

Browse files
authored
[Docs][BootstrapAdminUi] Copy usage with Sylius resource package (#301)
We already have this example code here https://github.com/Sylius/Stack/blob/main/docs/admin-ui/getting-started.md#crud-templates But to ensure that users find the information, we can also adding it here. https://stack.sylius.com/~/revisions/NuG6wpwKbLILmM1LB1yz/bootstrap-admin-ui/getting-started#configuring-the-crud-templates
2 parents 27b010c + cf155d0 commit 3c1f385

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/bootstrap-admin-ui/getting-started.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@ CRUD templates are split into configurable blocks.
2121

2222
You can add new blocks, disable existing ones, or reorder them using the [TwigHooks package](../twig-hooks/getting-started.md).
2323

24+
### Usage with the Sylius Resource package
25+
26+
{% code title="src/Entity/Speaker.php" lineNumbers="true" %}
27+
```php
28+
namespace App\Entity;
29+
30+
use Sylius\Resource\Metadata\AsResource;
31+
use Sylius\Resource\Model\ResourceInterface;
32+
33+
#[AsResource(
34+
// We still use the Sylius admin ui templates dir.
35+
templatesDir: '@SyliusAdminUi/crud',
36+
)]
37+
class Speaker implements ResourceInterface
38+
{
39+
// ...
40+
}
41+
42+
```
43+
{% endcode %}
44+
2445
### Create
2546

2647
This package sets up the template content needed to create a new resource.

0 commit comments

Comments
 (0)