Download the PHP package makinacorpus/static-passthrough-bundle without Composer
On this page you can find all versions of the php package makinacorpus/static-passthrough-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download makinacorpus/static-passthrough-bundle
More information about makinacorpus/static-passthrough-bundle
Files in makinacorpus/static-passthrough-bundle
Package static-passthrough-bundle
Short Description Easily serve a tree of statics files through Symfony
License MIT
Informations about the package static-passthrough-bundle
Static Passthrough Bundle: easily serve a tree of statics files through Symfony
This bundle has been developed for a simple use case : serve static files (e.g. generated documentation) through a Symfony application.
Getting started
1/ Install with Composer:
2/ Register the bundle
3/ Add Static Passthrough Routes definition
4/ Configure Static Passthrough
Let's assume we have a docs
folder in the root directory of our application, with a simple test.html
file in it:
that's the static file we want to serve through our Symfony app.
To do so, configure the bundle like this:
Don't forget to clear the cache:
5/ Reach the file with your browser :
Visit [app_basepath]/docs/test.html
, you should see your HTML file appear.
Note that you could also view it visiting [app_basepath]/docs/test
,
in fact when you try to visit [app_basepath]/docs/test
, the bundle will look for a file in these different paths, in that order:
[app_basepath]/docs/test
[app_basepath]/docs/test.html
[app_basepath]/docs/test/index.html
6/ Generate URL
Here is an examples to create an URL to reach 'test.html' file described above:
From a controller:
From twig:
All versions of static-passthrough-bundle with dependencies
symfony/framework-bundle Version ^5.4 || ^6.0 || ^7.0
symfony/mime Version ^5.4 || ^6.0 || ^7.0