Skip to content

Configuration ​

Every option, with its default:

yaml
# config/packages/easyadmin_embedded_list.yaml
easyadmin_embedded_list:
    fragment:
        # Request header, sent with the value 1, that marks a request for a list.
        header: X-EA-Fragment
        # Layout a list renders in place of the dashboard layout: only its `main` block.
        layout: '@EasyAdminEmbeddedList/layout.html.twig'
        # Whether a list keeps its filters and its batch actions. Their modals and
        # scripts are bound once, when the page loads: they would not work in a
        # list fetched later.
        filters: false
        batch_actions: false
    field:
        # Template of the field on index and detail pages.
        template: '@EasyAdminEmbeddedList/crud/field/embedded_list.html.twig'
        # Bootstrap columns of a labelled list in a form; an unlabelled one spans the row.
        columns: 'col-md-7 col-xxl-6'
    # Whether a confirmed POST action in a list (a delete) runs in place and
    # reloads the list, instead of leaving the page.
    inline_actions: true
    # Saves the session as soon as a list request has loaded the user.
    session:
        enabled: true
        # CSRF tokens a list mints that are checked by origin instead of the session.
        stateless_csrf_token_ids: [ea-toggle]
        stateless_csrf_token_prefixes: [ea-batch-action-]

Each option is also a container parameter, named by its path: easyadmin_embedded_list.fragment.header, easyadmin_embedded_list.field.columns…

Per field ​

MethodEffect
setEmbeddedController(BookCrudController::class, 'author')The CRUD controller and filter of a computed collection.
setTemplatePath('…')The index and detail template of this field.
setColumns('col-12')Its columns, as for any field.
setFormTypeOption('inline_actions', false)Row actions of this list leave the page.

Templates ​

TemplateRole
@EasyAdminEmbeddedList/form_theme.html.twigThe embedded_list_widget block: the placeholder.
@EasyAdminEmbeddedList/layout.html.twigThe fragment layout: the main block alone.
@EasyAdminEmbeddedList/crud/index.html.twigThe fragment index: your configured index, without the confirmation modal.
@EasyAdminEmbeddedList/crud/field/embedded_list.html.twigThe size of the collection.

Override one the Symfony way, in templates/bundles/EasyAdminEmbeddedListBundle/, or point the options above at your own.

Released under the MIT License.