class Bundle extends ContainerAware implements BundleInterface

Traits

Methods

setContainer(ContainerInterface $container = null)

Sets the Container.

string
getNamespace()

Gets the Bundle namespace.

string
getPath()

Gets the Bundle directory path.

boot()

Boots the Bundle.

shutdown()

Shutdowns the Bundle.

mixed
getRoutePath()

File path to load routes from

registerEvents(EventDispatcherInterface $dispatcher)

Register any events for the bundle

string
getParent()

Returns the bundle name that this bundle overrides.

string
getName()

Returns the bundle name (the class short name).

registerCommands(Application $application)

Finds and registers Commands.

Details

in ContainerAwareTrait at line 28
setContainer(ContainerInterface $container = null)

Sets the Container.

Parameters

ContainerInterface $container A ContainerInterface instance or null

at line 51
string getNamespace()

Gets the Bundle namespace.

Return Value

string The Bundle namespace

at line 65
string getPath()

Gets the Bundle directory path.

Return Value

string The Bundle absolute path

at line 75
boot()

Boots the Bundle.

at line 80
shutdown()

Shutdowns the Bundle.

at line 92
mixed getRoutePath()

File path to load routes from

/dir/to/routes.php

Return Value

mixed

at line 106
registerEvents(EventDispatcherInterface $dispatcher)

Register any events for the bundle

This is called after all bundles have been boot so you get access to all the services

Parameters

EventDispatcherInterface $dispatcher

at line 122
string getParent()

Returns the bundle name that this bundle overrides.

Despite its name, this method does not imply any parent/child relationship between the bundles, just a way to extend and override an existing bundle.

Return Value

string The Bundle name it overrides or null if no parent

at line 134
final string getName()

Returns the bundle name (the class short name).

Return Value

string The Bundle name

at line 156
registerCommands(Application $application)

Finds and registers Commands.

Override this method if your bundle commands do not follow the conventions:

  • Commands are in the 'Command' sub-directory
  • Commands extend Symfony\Component\Console\Command\Command

Parameters

Application $application An Application instance