symfony generate:app [--escaping-strategy="..."] [--csrf-secret="..."] application
Symfony contains a collection of generation tasks that assist in generating code and standard directory structure automatically. In addition to this task, they include generate:project?, generate:module?, and generate:task?.
Of particular importance of the files generated by this task are the front controllers. If the application being created is the first application to be generated, the production front controller for this application will be index.html. All successive front controllers will be named after the application itself.
- application - the name of the application you wish to generate
- --escaping-strategy=on - you can have code included that will prevent cross-site scripting (XSS) attacks; this enables output escaping; if you are developing a site that will be publicly accessible, and are in doubt, you should include this option.
- --csrf-secret=SomethingP4ssw0rdLike - this will cause a secret session token to be used to try to prevent Cross-Site Request Forgery (CSRF)
Both of the optional arguments can me adjusted at any time during development by changing configuration values in the settings.yml? file.
See also, the list of options? available to all symfony tasks.
From Jobeet, Chapter 12:
$ php symfony generate:app --escaping-strategy=on --csrf-secret=UniqueSecret1 backend