Is this even valid? Because it's working.
if(empty($query)) {
exit(View::forge('error', $data));
//View::forge('error', $data) = object
}
According to PHP manual exit should only accept "string" or "int" as parameter.
So I tried:
if(empty($query)) {
return View::forge('error', $data); //will not display
}
return View::forge('default', $data); //displays
But it seems it ignores it and displays the default template, so I tried combining it with exit:
if(empty($query)) {
return View::forge('error', $data); //will not display
exit;
}
return View::forge('default', $data); //displays
But still the same result, what I want to know that is exit($obj) valid in fuelphp? Because it seems it's working.
What I want to do is if query is empty page would display error template instead of default template, any help would be appreciated, thanks!