Hazaar\Controller::response() helper function
It might be nice to have a helper function for building responses rather than having to directly instantiate them as objects.
Use would be such as:
class Test extends \Hazaar\Controller {
function myAction(){
$id = 1234;
$user = \Application\Model\User::select($id);
$params = ['id' => $id, 'user' => $user];
return $this->response()->view('user/detail', $params);
}
}
For a vew response. Or say for a JSON response:
class Test extends \Hazaar\Controller {
function myAction(){
$id = 1234;
$user = \Application\Model\User::select($id);
$params = ['id' => $id, 'user' => $user];
return $this->response()->json($params);
}
}
Edited by Jamie Carl