This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » Symfony 2.0 » Many bundles in application
Many bundles in application [message #96781] Sun, 04 April 2010 21:04 Go to next message
hudson  is currently offline hudson
Messages: 18
Registered: December 2007
Junior Member
It is possible to use more than one bundle in application?

Look at common usecase (e.g. in sandbox):

We have main app bundle (e.g. HelloBundle). Front controller bootstraps request and create instance of HelloKernel. Now we can interact with HelloBunble functionality.

But if i need to create more complex application, with following bundles:

- CMSBundle
- ForumBundle
- BlogBundle
...

Seems like each bundle require our own front controller.

Or maybe i'm fool? Confused
Re: Many bundles in application [message #96836 is a reply to message #96781 ] Tue, 06 April 2010 09:30 Go to previous messageGo to next message
clac  is currently offline clac
Messages: 4
Registered: April 2010
Junior Member
It seems that yes, you can use more than one bundle in an application.
If I remember well, it is said so somewhere in the preview of SF 2.0.
I am also working on some little projects, to see how it works, and I have several bundles for an application. To use more than one bundle, you just have to register it in the "registerBundles" function in YourapplicationKernel.php file.
Re: Many bundles in application [message #96837 is a reply to message #96836 ] Tue, 06 April 2010 10:01 Go to previous message
hudson  is currently offline hudson
Messages: 18
Registered: December 2007
Junior Member
Fabien, thanks for response!

But seems like i have great missunderstood )) Please look at the front controller code:

<?php
require_once __DIR__.'/../hello/HelloKernel.php';
$kernel = new HelloKernel('prod', false);
$kernel->run();


I think that only one bundle (via new BundleNameKernel()) can be started in front controller. Does another bundles (which have been registered in registerBundles()) dont need direct initialization?
Previous Topic:Starting New Project Symfony 2
Next Topic:mistake in quick tour of Symfony 2.0 ?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software