Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefix #90

Open
davidsanz opened this issue Sep 20, 2016 · 10 comments
Open

prefix #90

davidsanz opened this issue Sep 20, 2016 · 10 comments
Labels

Comments

@davidsanz
Copy link

davidsanz commented Sep 20, 2016

Hello.

I use symfony 3.1 and if put prefix routing in app/config/routing like this:

prefix:
        en: /website
        fr: /site
        de: /webseite

got this error:

Warning: trim() expects parameter 1 to be string, array given in /Users/davidsanz/Documents/httpdocs/perieven/app/config/routing.yml (which is being imported from "/Users/davidsanz/Documents/httpdocs/perieven/app/config/routing_dev.yml").

Can help me please.

Thanks!

@aistis-
Copy link

aistis- commented Sep 22, 2016

I confirm it is a bug - I have the same issue on Symfony 3.1

@boekkooi
Copy link
Collaborator

Hi @davidsanz,

Did you by any chance for get the type: be_simple_i18n in you route definition?

@aistis-
Copy link

aistis- commented Sep 25, 2016

I've managed to replicate it with type: be_simple_i18n set.

EDIT: looks like I forgot to add type: be_simple_i18n to the parent routing file of the one where multilanguage prefix is defined. So it works for me on 3.1 Symfony :) Thanks @boekkooi

@davidsanz
Copy link
Author

davidsanz commented Sep 26, 2016

I dont know why but i've this error:
Warning: trim() expects parameter 1 to be string, array given in C:\wamp\www\perieven\app/config\routing.yml (which is being imported from "C:\wamp\www\perieven\app/config/routing_dev.yml")
with this routing file:
expedientes:

    resource: "@ExpedientesBundle/Resources/config/routing.yml"
    type: be_simple_i18n
    prefix:
        es: /expedientes
        en: /files
        it: /cartella
        de: /fahrzeug-unterlagen
        fr: /archives

@aistis-
Copy link

aistis- commented Sep 26, 2016

I guess app/config/routing.yml itself isn't loaded as be_simple_i18n type, so it throes an error. An easy workaround would be to have one more middle file in the routing files tree. Maybe there is a better way to define app/config/routing.yml as be_simple_i18n resource 💡

@aistis-
Copy link

aistis- commented Sep 27, 2016

@davidsanz try in you app/config/config.yml add:

framework:
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        type: be_simple_i18n

@davidsanz
Copy link
Author

Thanks aistis- but dont work. Return same error.

@boekkooi boekkooi added the Bug label Feb 18, 2017
@kardi31
Copy link

kardi31 commented Feb 23, 2017

I've got the same error. Any updates on this issue?

@anelad
Copy link

anelad commented Mar 15, 2017

You can solve that issue with changing routing_dev.yml;

//routing_dev.yml
.....
....
_main:
    resource: routing.yml
    type: be_simple_i18n

@ibrambe
Copy link

ibrambe commented Apr 4, 2018

@anelad That fix makes your app_dev.php work, but production (app.php) won't work that way.

This issue wasn't there in beta1, only in 2.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants