I'm using Kohana v3 for a web project, and today I found myself writing this:
echo Html::anchor('user/view/'.$user->id, "See user's profile");
If I rename the action_view
method in the User controller, the link will be broken. To avoid this, I created a function in the User model that returns the URL used for viewing the user's profile:
echo Html::anchor($user->url_view(), "See user's profile");
There is another (cleaner) way to do this (similar to Django's url()
and {% url %}
)?
PS: Excuse my English.