I'm trying to add simple links in kohana inside a view inside a loop .
Here is the code i have :
echo HTML::anchor(Route::get('parent')->uri(array('id' => $parent->id)), HTML::chars($parent->email))
Now this return a link to root because
Route::get('parent')->uri(array('id' => $parent->id)
returns an empty string .
Now if If i modify my Route::get to :
Route::get('parent')->uri(array(
'controller' => 'parent' ,
'action' => 'index' ,
'id' => $parent->id))
I get the correct link .
Question : Why Kohana is not able to get the correct link knowing that in my bootstrap i have the following :
Route::set('parent', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'parent',
'action' => 'index',
));
And that : Route::get('parent') returns :
: object(Route) =
_callback: undefined = NULL
_uri: string = "(<controller>(/<action>(/<id>)))"
_regex: array =
_defaults: array =
controller: string = "parent"
action: string = "index"
_route_regex: string = "#^(?:(?P<controller>[^/.,;?\\n]++)(?:/(?P<action>[^/.,;?\\n]++)(?:/(?P<id>[^/.,;?\\n]++))?)?)?\$#uD"