symfony:symfony_tutorial_notes:the_bundle_system
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
symfony:symfony_tutorial_notes:the_bundle_system [2015/09/17 01:15] – [The Bundle System] mithat | symfony:symfony_tutorial_notes:the_bundle_system [2015/09/18 04:04] (current) – [Bundle Directory Structure] mithat | ||
---|---|---|---|
Line 37: | Line 37: | ||
===== Creating a Bundle ===== | ===== Creating a Bundle ===== | ||
- | TODO | + | To create '' |
+ | - create a '' | ||
+ | namespace Acme\TestBundle; | ||
+ | |||
+ | use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
+ | |||
+ | class AcmeTestBundle extends Bundle | ||
+ | { | ||
+ | } | ||
+ | </ | ||
+ | - enable it via the AppKernel class:< | ||
+ | public function registerBundles() | ||
+ | { | ||
+ | $bundles = array( | ||
+ | // ... | ||
+ | // register your bundle | ||
+ | new Acme\TestBundle\AcmeTestBundle(), | ||
+ | ); | ||
+ | // ... | ||
+ | |||
+ | return $bundles; | ||
+ | } | ||
+ | </ | ||
+ | - Hack on controllers, | ||
+ | |||
+ | To create '' | ||
+ | * <code bash>$ php app/console generate: | ||
+ | |||
+ | The bundle skeleton generates a basic controller, template, and routing resource. | ||
+ | |||
+ | The '' | ||
+ | |||
+ | See [[http:// | ||
===== Bundle Directory Structure ===== | ===== Bundle Directory Structure ===== | ||
Line 51: | Line 83: | ||
| | ||
<WRAP center round tip 100%> | <WRAP center round tip 100%> | ||
- | Note that the current best practice | + | Note that the current |
- | * **controllers** go in '' | + | * **config** goes in '' |
- | * **config** goes in '' | + | * **controllers** go in '' |
- | * **views** go in '' | + | * **views** go in '' |
- | * **assets** go in TBD | + | * **assets** go in '' |
* **tests** go in TBD | * **tests** go in TBD | ||
</ | </ | ||
symfony/symfony_tutorial_notes/the_bundle_system.1442452526.txt.gz · Last modified: 2015/09/17 01:15 by mithat