I\'d like to do something like this:
/**
* @Route(\"^/secured\") <-- this would not work, just an example
*/
public function securedAction(){
//retur
/**
* @Route("/secured/{anything}", name="_secured", defaults={"anything" = null}, requirements={"anything"=".+"})
*/
public function securedAction($anything){
//return secured JS frontend
}
name - just name of the route.
defaults - here you can set default value of the parameter, if you not provide parameter in the url: /secured/
requirements - requirements for parameter(s), in this case anything can contain forward slash: http://symfony.com/doc/current/cookbook/routing/slash_in_parameter.html , but you must handle it in your controller action yourself:
for example if you provide url: /secured/anything/another_thing/one_more_thing
you can get all parameters by explode('/', $anything);
and the results will be:
array:3 [
0 => "anything"
1 => "another_thing"
2 => "one_more_thing" ]
Just everything after /secured/ will be one parameter $anything.