I am proud to present my first public mini-project, StaticBundle . This largely allows you to include any file in a bunch directly into the template.
Customization
EDIT The package can now be installed using the composer, see readme instructions.
Add the following to deps :
[KGStaticBundle] git=git:
Run bin/vendors install .
Register the namespace in app/autoload.php :
'KG' => __DIR__.'/../vendor/bundles',
Register the node in app/AppKernel.php :
new KG\StaticBundle\KGStaticBUndle(),
Main use
Suppose the src/Acme/Bundle/DemoBundle/Static/hello.txt ready to be included in the template. We need to use the file function:
{
The logical name resolves to the actual path, and a simple file_get_contents retrieves the data.
source share