2015-09-17 23:11:18 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Aviat\Ion\View;
|
|
|
|
|
|
|
|
use Aura\Web\ResponseSender;
|
|
|
|
|
|
|
|
use Aviat\Ion\View as BaseView;
|
|
|
|
|
2015-10-09 22:29:59 -04:00
|
|
|
/**
|
|
|
|
* Base view class for Http output
|
|
|
|
*/
|
2015-09-17 23:11:18 -04:00
|
|
|
class HttpView extends BaseView {
|
2015-10-09 22:29:59 -04:00
|
|
|
|
2015-09-17 23:11:18 -04:00
|
|
|
/**
|
|
|
|
* Do a redirect
|
2015-10-09 22:29:59 -04:00
|
|
|
*
|
2015-09-17 23:11:18 -04:00
|
|
|
* @param string $url
|
|
|
|
* @param int $code
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function redirect($url, $code)
|
|
|
|
{
|
|
|
|
$this->response->redirect->to($url, $code);
|
|
|
|
}
|
2015-10-09 22:29:59 -04:00
|
|
|
|
2015-09-17 23:11:18 -04:00
|
|
|
/**
|
|
|
|
* Send the appropriate response
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function output()
|
|
|
|
{
|
|
|
|
parent::output();
|
|
|
|
|
|
|
|
$sender = new ResponseSender($this->response);
|
|
|
|
$sender->__invoke();
|
|
|
|
}
|
2015-10-09 22:29:59 -04:00
|
|
|
|
2015-09-17 23:11:18 -04:00
|
|
|
}
|