Hi
I am trying to create a custom profile page to display for each my website users.
I am trying to use a route to a custom template, but something seems to be buggy.
My router is:
c::set('routes', array(
array(
'pattern' => 'user/(:any)',
'action' => function($usid) {
// do something here when the URL matches the pattern above
return tpl::load(kirby()->roots()->templates() . DS . 'user.php', array('usid' => $usid), false);
}
)
));
Bu then, within the user.php
file, when I try to call the $site
object, nothing happens… so this:
<? echo $site->url(); ?>
will not return anything… However, this:
<? echo $usid ?>
does return the correct value passed by the router.
I am doing something wrong here?