I tried to use LocaleBundle in a Symfony 4 project that also uses flex and when I try to use LocaleSwitcher along with use_controller=true, then it triggers the following error:
'Invalid resource "/vagrant/var/cache/dev/lunetics_locale/routing.yml" passed to the "service" route loader: use the format "service_name:methodName"'
I found that this is set in RouterResourcePass which sets router.resource as /vagrant/var/cache/dev/lunetics_locale/routing.yml and it is expecting something like the kernel:loadRoutes that is loaded by default in the router config.
This is my router config (default):
framework:
router:
strict_requirements: ~
And this is the bundle config:
lunetics_locale:
guessing_order:
- router
- session
- browser
allowed_locales:
- en
- es
- fr
cookie:
set_on_change: true
switcher:
template: LocaleSwitcher/switcher_links.html.twig
use_controller: true
use_referrer: true
redirect_to_route: homepage
redirect_statuscode: 302
Am I doing something wrong? Or is this an incompatibility with Symfony 4?
Thanks in advance.
I tried to use LocaleBundle in a Symfony 4 project that also uses flex and when I try to use LocaleSwitcher along with use_controller=true, then it triggers the following error:
'Invalid resource "/vagrant/var/cache/dev/lunetics_locale/routing.yml" passed to the "service" route loader: use the format "service_name:methodName"'I found that this is set in RouterResourcePass which sets
router.resourceas/vagrant/var/cache/dev/lunetics_locale/routing.ymland it is expecting something like thekernel:loadRoutesthat is loaded by default in the router config.This is my router config (default):
And this is the bundle config:
Am I doing something wrong? Or is this an incompatibility with Symfony 4?
Thanks in advance.