How to create a new bundle in Symfony 2

How to create a new bundle in Symfony 2

Create a bundle with the command below:

php app/console generate:bundle

The we need give it a bundle name which has a format like this:

[project_name]/Bundle/[Category]Bundle

Choose yml as config format.

After the bundle created, you may change the route in the path below. The route defines page's url

/src/[project_name]/Bundle/[category]Bundle/Resources/config/routing.yml

You may find your views in the path below:

/src/[project_name]/Bundle/[category]Bundle/Resources/views/Default/index.html.twig

 

blog tag: