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

Dot in a named route #4

Closed
SaphiLC opened this issue Feb 2, 2018 · 4 comments
Closed

Dot in a named route #4

SaphiLC opened this issue Feb 2, 2018 · 4 comments
Labels

Comments

@SaphiLC
Copy link

SaphiLC commented Feb 2, 2018

if i have a named route like this

@account.signin

f3-access ignores the route or cant find it

@xfra35
Copy link
Owner

xfra35 commented Feb 2, 2018

F3 routes should not contain dots. Only alphanumeric characters and underscores.

Just rename your route to account_signin.

@xfra35 xfra35 closed this as completed Feb 2, 2018
@xfra35 xfra35 added the invalid label Feb 2, 2018
@SaphiLC
Copy link
Author

SaphiLC commented Feb 2, 2018

i always used dots in named routes with no problems at all (in F3)

@xfra35
Copy link
Owner

xfra35 commented Feb 2, 2018

Really? But then you were lucky. If you look at the framework code:

  • mock() expects alphanumeric aliases (=dots forbidden)
  • route() expects alphanumeric aliases when you're calling the same alias twice (e.g POST @account_signin = MyController)
  • you can't call $f3->get('ALIASES.account.signin')

The reason why you could define aliases with dots is that the regex used in the route() method is a bit too permissive. IMHO this is a bug. But I'll submit this to the community so we can sort this out.

@SaphiLC
Copy link
Author

SaphiLC commented Feb 2, 2018

oh well, ill change to _ :(
thanks

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

2 participants