Skip to content

Commit

Permalink
minor #3722 Update crud.rst (ThomasLandauer)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.0.x-dev branch.

Discussion
----------

Update crud.rst

Including my use case from #3463 (comment)

Commits
-------

8edfa57 Update crud.rst
  • Loading branch information
javiereguiluz committed Sep 5, 2020
2 parents e440f0b + 8edfa57 commit 63d30f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/crud.rst
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,11 @@ The same applies to URLs generated in Twig templates:
.setController('App\\Controller\\Admin\\ProductCrudController')
.setAction('index') %}
If you want to create a link for the "edit" action, you need to pass the entity's ID:

.. code-block:: twig
{{ ea_url().setController('App\\Controller\\Admin\\ProductCrudController').setAction(constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Action::EDIT')).setEntityId(product.id) }}
.. _`Symfony controllers`: https://symfony.com/doc/current/controller.html
.. _`How to Create a Custom Form Field Type`: https://symfony.com/doc/current/cookbook/form/create_custom_field_type.html
.. _`Symfony Form types`: https://symfony.com/doc/current/reference/forms/types.html
Expand Down

0 comments on commit 63d30f6

Please sign in to comment.