Автозамены регионов

This commit is contained in:
Konstantin
2026-05-30 17:43:37 +03:00
parent df8cf22112
commit 6c8a012702
16 changed files with 317 additions and 18 deletions
+3 -2
View File
@@ -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'
// )
);
);
+7 -1
View File
@@ -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) {