Questions & Feedback
Found a typo or an error?
Want to improve this document? Edit it.
Need support or have a technical question?
Post to the user mailing-list.
Attribution-Share Alike 3.0
Generating a New Bundle Skeleton
Generating a New Bundle Skeleton¶
generate:bundle generates a new bundle structure and automatically
activates it in the application.
By default the command is run in the interactive mode and asks questions to determine the bundle name, location, configuration format and default structure:
php app/console generate:bundle
To deactivate the interactive mode, use the --no-interaction option but don't forget to pass all needed options:
php app/console generate:bundle --namespace=Acme/Bundle/BlogBundle --no-interaction
--namespace: The namespace of the bundle to create. The namespace should begin with a "vendor" name like your company name, your project name, or your client name, followed by one or more optional category sub-namespaces, and it should end with the bundle name itself (which must have Bundle as a suffix):
php app/console generate:bundle --namespace=Acme/Bundle/BlogBundle
--bundle-name: The optional bundle name. It must be a string ending with the
php app/console generate:bundle --bundle-name=AcmeBlogBundle
--dir: The directory in which to store the bundle. By convention, the command detects and uses the applications's
php app/console generate:bundle --dir=/var/www/myproject/src
--format: (annotation) [values: yml, xml, php or annotation] Determine the format to use for the generated configuration files like routing. By default, the command uses the
annotationformat. Choosing the
annotationformat expects the
SensioFrameworkExtraBundleis already installed:
php app/console generate:bundle --format=annotation
--structure: (no) [values: yes|no] Whether or not to generate a complete default directory structure including empty public folders for documentation, web assets and translations dictionaries:
php app/console generate:bundle --structure=yes