Hi all,
I want to display nested loops.
My simple model is following. Category can contain tasks. I want to loop categories and show all tasks within category.
My controller is following:
public function GetCategories() {
return Office_TaskCategory::get();
}
public function GetTasks($category) {
return Office_Task::get()->filter(array(
'CategoryID' => intval($category)
));
}
and view:
<% loop $GetCategories %>
$Title
<ul>
<% loop $GetTasks($ID) %>
<li>$Title</li>
<% end_loop %>
</ul>
<% end_loop %>
but it returns only Title of categories, it not iterates through tasks.
Could you please help me how to fix it?
thanks a lot