Fix line endings in view classes
This commit is contained in:
parent
993b625042
commit
b4949eaea2
@ -72,7 +72,7 @@ abstract class View {
|
|||||||
{
|
{
|
||||||
$this->send();
|
$this->send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return rendered output
|
* Return rendered output
|
||||||
@ -119,11 +119,13 @@ abstract class View {
|
|||||||
public function getOutput()
|
public function getOutput()
|
||||||
{
|
{
|
||||||
return $this->string($this->output)->__toString();
|
return $this->string($this->output)->__toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send output to client
|
* Send output to client
|
||||||
*/
|
*
|
||||||
abstract public function send();
|
* @return void
|
||||||
|
*/
|
||||||
|
abstract public function send();
|
||||||
}
|
}
|
||||||
// End of View.php
|
// End of View.php
|
@ -31,44 +31,46 @@ class HttpView extends BaseView {
|
|||||||
public function redirect($url, $code)
|
public function redirect($url, $code)
|
||||||
{
|
{
|
||||||
$this->response->redirect->to($url, $code);
|
$this->response->redirect->to($url, $code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the status code of the request
|
* Set the status code of the request
|
||||||
*
|
*
|
||||||
* @param int $code
|
* @param int $code
|
||||||
* @return HttpView
|
* @return HttpView
|
||||||
*/
|
*/
|
||||||
public function setStatusCode($code)
|
public function setStatusCode($code)
|
||||||
{
|
{
|
||||||
$this->response->status->setCode($code);
|
$this->response->status->setCode($code);
|
||||||
$this->response->status->setVersion(1.1);
|
$this->response->status->setVersion(1.1);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send output to client
|
* Send output to client
|
||||||
*/
|
*
|
||||||
public function send()
|
* @return void
|
||||||
{
|
*/
|
||||||
$this->hasRendered = TRUE;
|
public function send()
|
||||||
$this->output();
|
{
|
||||||
}
|
$this->hasRendered = TRUE;
|
||||||
|
$this->output();
|
||||||
/**
|
}
|
||||||
* Send the appropriate response
|
|
||||||
*
|
/**
|
||||||
* @return void
|
* Send the appropriate response
|
||||||
*/
|
*
|
||||||
protected function output()
|
* @return void
|
||||||
{
|
*/
|
||||||
$content =& $this->response->content;
|
protected function output()
|
||||||
$content->set($this->output);
|
{
|
||||||
$content->setType($this->contentType);
|
$content =& $this->response->content;
|
||||||
$content->setCharset('utf-8');
|
$content->set($this->output);
|
||||||
|
$content->setType($this->contentType);
|
||||||
$sender = new ResponseSender($this->response);
|
$content->setCharset('utf-8');
|
||||||
$sender->__invoke();
|
|
||||||
}
|
$sender = new ResponseSender($this->response);
|
||||||
|
$sender->__invoke();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user