Автозамены регионов
This commit is contained in:
@@ -35,7 +35,8 @@ $_['action_pre_action'] = array(
|
||||
'startup/error',
|
||||
'startup/event',
|
||||
'startup/maintenance',
|
||||
'startup/seo_url'
|
||||
'startup/seo_url',
|
||||
'startup/region_replacement'
|
||||
);
|
||||
|
||||
// Action Events
|
||||
@@ -59,4 +60,4 @@ $_['action_event'] = array(
|
||||
//'controller/*/after' => array(
|
||||
// 'event/debug/after'
|
||||
// )
|
||||
);
|
||||
);
|
||||
|
||||
@@ -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