console.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. sonata:admin:list
  24. -----------------
  25. If you wish to see which admin services are available, you can use
  26. ``sonata:admin:list`` command. It prints all the admin service ids available in
  27. your application. Command gets ids from ``sonata.admin.pool`` service where all
  28. the available admin services are present.
  29. Usage example:
  30. .. code-block:: bash
  31. php app/console sonata:admin:list
  32. sonata:admin:setup-acl
  33. ----------------------
  34. The ``sonata:admin:setup-acl`` command updates ACL definitions for all admin
  35. classes available in ``sonata.admin.pool``. For instance everytime you create a
  36. new ``Admin`` class, you can create ACL by using the ``sonata:admin:setup-acl``
  37. command. The ACL database will be automatically updated with the latest masks
  38. and roles informations.
  39. Usage example:
  40. .. code-block:: bash
  41. php app/console sonata:admin:setup-acl