Version

Documentation » Admin

18. Preview Mode »

« 16. Advance

17. Console/Command-Line Commands

SonataAdminBundle provides the following console commands:

  • cache:create-cache-class
  • sonata:admin:explain
  • sonata:admin:list
  • sonata:admin:setup-acl

17.1. cache:create-cache-class

The cache:create-cache-class command generates the cache class (app/cache/...env.../classes.php) from the classes.map file.

Usage example:

php app/console cache:create-cache-class

17.2. sonata:admin:explain

The sonata:admin:explain command prints details about the admin of a model. As an argument you need to specify admin service id of the model you need explaining.

Usage example:

php app/console sonata:admin:explain sonata.news.admin.post
Explain command

Explain command

17.3. sonata:admin:list

If you wish to see which admin services are available, you can use sonata:admin:list command. It prints all the admin service ids available in your application. Command gets ids from sonata.admin.pool service where all the available admin services are present.

Usage example:

php app/console sonata:admin:list
List command

List command

17.4. sonata:admin:setup-acl

The sonata:admin:setup-acl command updates ACL definitions for all admin classes available in sonata.admin.pool. For instance every time you create a new Admin class, you can create ACL by using the sonata:admin:setup-acl command. The ACL database will be automatically updated with the latest masks and roles informations.

Usage example:

php app/console sonata:admin:setup-acl

Found a typo? Something is wrong in this documentation? Just fork and edit it!