Автозамены регионов
This commit is contained in:
@@ -14,6 +14,7 @@ class Response {
|
||||
private $headers = array();
|
||||
private $level = 0;
|
||||
private $output;
|
||||
private $replacements = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -63,6 +64,10 @@ class Response {
|
||||
public function setOutput($output) {
|
||||
$this->output = $output;
|
||||
}
|
||||
|
||||
public function setReplacements($replacements) {
|
||||
$this->replacements = is_array($replacements) ? $replacements : array();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -107,7 +112,8 @@ class Response {
|
||||
*/
|
||||
public function output() {
|
||||
if ($this->output) {
|
||||
$output = $this->level ? $this->compress($this->output, $this->level) : $this->output;
|
||||
$output = $this->replacements ? strtr($this->output, $this->replacements) : $this->output;
|
||||
$output = $this->level ? $this->compress($output, $this->level) : $output;
|
||||
|
||||
if (!headers_sent()) {
|
||||
foreach ($this->headers as $header) {
|
||||
|
||||
Reference in New Issue
Block a user