bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Named route incorrectly includes the extra @params in the route

aymanhs opened this issue · comments

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.

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

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.