Closed tugrul closed 5 years ago
We can expose routes for only one domain in actual functionality.
/** * @Route("/a-page", * options = { "expose" = true }, * name = "my_route_to_expose_with_defaults", * ) */
Able to expose routes to different domains like following.
/** * @Route("/a-page", * options = { "expose" = "blog" }, * name = "my_route_to_expose_blog", * ) */ /** * @Route("/a-secret-page", * options = { "expose" = "admin" }, * name = "my_route_to_expose_admin", * ) */
Then we can expose routes by different contexts like following.
<script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData", "domain": "blog"}) }}"></script> <script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData", "domain": "admin"}) }}"></script>
also
$ php bin/console fos:js-routing:dump --domain=blog
<script src="/js/fos_js_routes_blog.js"></script>
$ php bin/console fos:js-routing:dump --domain=admin
<script src="/js/fos_js_routes_admin.js"></script>
{ "expose" = true } able to mean {"expose" = "default"} or {"expose" = "main"} to backward compatibility
{ "expose" = true }
{"expose" = "default"}
{"expose" = "main"}
Also merge all of domains' routes into single dump if we don't provide domain name like following.
$ php bin/console fos:js-routing:dump
<script src="/js/fos_js_routes.js"></script>
Also we can combine domain names
$ php bin/console fos:js-routing:dump --domain=admin,blog
<script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData", "domain": ["blog", admin]}) }}"></script>
Closed via #347
We can expose routes for only one domain in actual functionality.
Able to expose routes to different domains like following.
Then we can expose routes by different contexts like following.
also
{ "expose" = true }
able to mean{"expose" = "default"}
or{"expose" = "main"}
to backward compatibilityAlso merge all of domains' routes into single dump if we don't provide domain name like following.
Also we can combine domain names