events.rst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Events
  2. ======
  3. An event mechanism is available to add an extra entry point to extend an Admin instance.
  4. ConfigureEvent
  5. ~~~~~~~~~~~~~~
  6. This event is generated when a form, list, show, datagrid is configured. The event names are:
  7. - ``sonata.admin.event.configure.form``
  8. - ``sonata.admin.event.configure.list``
  9. - ``sonata.admin.event.configure.datagrid``
  10. - ``sonata.admin.event.configure.show``
  11. PersistenceEvent
  12. ~~~~~~~~~~~~~~~~
  13. This event is generated when a persistency layer update, save or delete an object. The event names are:
  14. - ``sonata.admin.event.persistence.pre_update``
  15. - ``sonata.admin.event.persistence.post_update``
  16. - ``sonata.admin.event.persistence.pre_persist``
  17. - ``sonata.admin.event.persistence.post_persist``
  18. - ``sonata.admin.event.persistence.pre_remove``
  19. - ``sonata.admin.event.persistence.post_remove``
  20. ConfigureQueryEvent
  21. ~~~~~~~~~~~~~~~~~~~
  22. This event is generated when a list query is defined. The event name is: ``sonata.admin.event.configure.query``
  23. BlockEvent
  24. ~~~~~~~~~~
  25. Block events help you customize your templates. Available events are :
  26. - ``sonata.admin.dashboard.top``
  27. - ``sonata.admin.dashboard.bottom``
  28. - ``sonata.admin.list.table.top``
  29. - ``sonata.admin.list.table.bottom``
  30. - ``sonata.admin.edit.form.top``
  31. - ``sonata.admin.edit.form.bottom``
  32. - ``sonata.admin.show.top``
  33. - ``sonata.admin.show.bottom``
  34. If you want more information about block events, you should check the
  35. `"Event" section of block bundle documentation <https://sonata-project.org/bundles/block/master/doc/reference/events.html>`_.