Basic operations

In this cookbook, we assume that you have already created a Book resource.

circle-info

Learn more on how to create a Sylius resource.

List of resources

List of books

Create a grid for your resource using Symfony's Maker Bundle.

Note: To ease the setup, it is recommended to have an existing Doctrine Entity configured.

Magic! Here is the generated grid.

Configure the index operation in your resource.

circle-info

Note: When you are in a Sylius project, the templatesDir path is: @SyliusAdmin/shared/crud

Use the Symfony debug:router command to check the results.

Your route should look like this:

Resource creation page

Book creation page

Create a form type for your resource.

Configure the create operation in your resource.

circle-info

Note: When you are in a Sylius project, the templatesDir path is: @SyliusAdmin/shared/crud

Use the Symfony debug:router command to check the results.

Your route should look like this:

Resource edition page

Book edition page

Ensure you already created the Symfony form type in the previous section.

Configure the update operation in your resource.

circle-info

Note: When you are in a Sylius project, the templatesDir path is: @SyliusAdmin/shared/crud

Use the Symfony debug:router command to check the results.

Your route should look like this:

Resource details page

Book details page

Configure the show operation in your resource.

circle-info

Note: When you are in a Sylius project, the templatesDir path is: @SyliusAdmin/shared/crud

Use the Symfony debug:router command to check the results.

Your route should look like this:

Now we need to configure the templates.

circle-info

Note that you can also replace the default title.

Last updated

Was this helpful?