In Symfony2's routing.yml
, I understand it's possible to route to a static HTML page, like this:
my_static_route:
path: /mycomponent
defaults:
_controller: FrameworkBundle:Template:template
template: @StubbornShowaBundle/Resources/public/imports/component.html
My question is, is there any way to do variable routing in routing.yml
using FrameworkBundle:Template:template
?
Like this(doesn't work, just an image of what I want to do):
my_static_route:
path: /mycomponents/{file}
defaults:
_controller: FrameworkBundle:Template:template
template: @StubbornShowaBundle/Resources/public/imports/{file}
And then /mycomponents/foobar.html
would load @StubbornShowaBundle/Resources/public/imports/foobar.html
Is that possible? (And if so, how do I do that?)