console.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. Console/Command-Line Commands
  2. =============================
  3. SonataAdminBundle provides the following console commands:
  4. * ``cache:create-cache-class``
  5. * ``sonata:admin:explain``
  6. * ``sonata:admin:list``
  7. * ``sonata:admin:setup-acl``
  8. cache:create-cache-class
  9. ------------------------
  10. The ``cache:create-cache-class`` command generates the cache class
  11. (``app/cache/...env.../classes.php``) from the classes.map file.
  12. Usage example:
  13. .. code-block:: bash
  14. php app/console cache:create-cache-class
  15. sonata:admin:explain
  16. --------------------
  17. The ``sonata:admin:explain`` command prints details about the admin of a model.
  18. As an argument you need to specify admin service id of the model you need
  19. explaining.
  20. Usage example:
  21. .. code-block:: bash
  22. php app/console sonata:admin:explain sonata.news.admin.post
  23. .. figure:: ../images/console_admin_explain.png
  24. :align: center
  25. :alt: Explain command
  26. :width: 700px
  27. Explain command
  28. sonata:admin:list
  29. -----------------
  30. If you wish to see which admin services are available, you can use
  31. ``sonata:admin:list`` command. It prints all the admin service ids available in
  32. your application. Command gets ids from ``sonata.admin.pool`` service where all
  33. the available admin services are present.
  34. Usage example:
  35. .. code-block:: bash
  36. php app/console sonata:admin:list
  37. .. figure:: ../images/console_admin_list.png
  38. :align: center
  39. :alt: List command
  40. :width: 700px
  41. List command
  42. sonata:admin:setup-acl
  43. ----------------------
  44. The ``sonata:admin:setup-acl`` command updates ACL definitions for all admin
  45. classes available in ``sonata.admin.pool``. For instance every time you create a
  46. new ``Admin`` class, you can create ACL by using the ``sonata:admin:setup-acl``
  47. command. The ACL database will be automatically updated with the latest masks
  48. and roles informations.
  49. Usage example:
  50. .. code-block:: bash
  51. php app/console sonata:admin:setup-acl