breadcrumbs.rst 877 B

12345678910111213141516171819202122232425262728
  1. The breadcrumbs builder
  2. =======================
  3. The ``sonata.admin.breadcrumbs_builder`` service is used in the layout of every
  4. page to compute the underlying data for two breadcrumbs:
  5. * one as text, appearing in the ``title`` tag of the document's ``head`` tag;
  6. * the other as html, visible as an horizontal bar at the top of the page.
  7. Getting the breadcrumbs for a given action of a given admin is done like this:
  8. .. code-block:: php
  9. <?php
  10. $this->get('sonata.admin.breadcrumbs_builder')->getBreadcrumbs($admin, $action);
  11. Configuration
  12. -------------
  13. .. configuration-block::
  14. .. code-block:: yaml
  15. # app/config/config.yml
  16. sonata_admin:
  17. breadcrumbs:
  18. # use this to change the default route used to generate the link to the parent object inside a breadcrumb, when in a child admin
  19. child_admin_route: edit