Please note this project is now OBSOLETE and will NOT work with recent versions of Symfony and Silex.
"Un peu de Silex dans votre Symfony ?"
SilexBundle allows you to include Silex applications in your Symfony2 project.
Directly clone the Bundle into your project:
cd /path/to/your/project git clone git://github.com/geoffrey/SilexBundle.git src/Panda/SilexBundle
Or the submodule alternative:
cd /path/to/your/project git submodule add git://github.com/geoffrey/SilexBundle.git src/Panda/SilexBundle
Don't forget to add the bundle in your
Soooo, actually, you have to care about the way you write your Silex app in order to be able to include it through SilexBundle. The autoloading part may cause some trouble, so you'll have to separate it in two:
one part with the generic autoloading, that is Silex and all the Symfony components (which will obviously already be loaded by Symfony2). This autoloading part should be put in a separate file.
one part with your app's specific autoloading. For example, with Sismo I kept the Sismo namespace autoloading.
Then you have to write a file that will return your $app, just like when you want to mount it into another silex app:
<?php // build your $app return $app
It's that file that you'll want to set as the
path of your app in the bundle's
Sorry if it's still a bit unclear, it's 1am here, I'll update the documentation tomorrow, but basically it all boils down to this: don't conflict autoloaders.
SilexBundle provides a command to publish your assets:
It works just like the default