bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!
2.66k stars 446 forks source link

Named route incorrectly includes the extra @params in the route #1270

Closed aymanhs closed 1 year ago

aymanhs commented 1 year ago

Using this latest build as of now.

I have this route rule:

$f3->route('GET @user_edit: /users/@id',

The route itself works fine.

However when I have this in the template:

<a href="{{@ALIASES.user_edit}}/{{@user.id}}">

The link it generates is /users/@id/3

The @id is incorrect.

Blue3957 commented 1 year ago

That's expected behaviour, {{@ALIASES.user_edit}} resolves to /users/@id.

You want to use <a href="{{ 'user_edit', 'id=' . @user.id | alias}}">, as specified in the documentation

aymanhs commented 1 year ago

Thank you! May I say that this framework has restored my faith in php ;-) It is an absolute joy to work with!

Maybe this needs to be clear in the user guide, as it is not mentioned properly there. I'm refering to the readme in the main github.com page.