Snippet: symfony simple frecuently used commands

Syntaxis for some simple but frecuently used symfony commands

Database

Configure symfony to use especific mysql database

$ symfony configure:database "mysql:host=localhost;dbname=my_database" user_name password

Rebuild all. This command rebuild models, form, and tables, so destroy all data in database.

$ symfony propel:build-all

Rebuild all and load test data. This command rebuild models, form, and tables, so destroy all data in database and reload it from fixture files.

$ symfony propel:build-all-load

Frontend and Backend

Frontend Aplication. Generate frontend application

$ symfony generate:app --escaping-strategy=on --csrf-secret=FrontendSecret frontend

Frontend Module. Generate a module called module_name in frontend application. The module will have a show action in addition to the new, edit and delete ones.

$ symfony propel:generate-module --with-show --non-verbose-templates frontend module_name ModelObject

BackEnd Aplication. Generate backend application

$ symfony generate:app --escaping-strategy=on --csrf-secret=BackendSecret backend

BackEnd Module. Generate a fully functional module called ‘module_name’ in the backend, based on the model object named ‘ModuleObject’.

$ symfony propel:generate-admin backend ModuleObject --module=module_name