1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
UrlRewriterRuleMaker.php
См. документацию.
1<?php
2
3namespace Bitrix\Main;
4
13{
14 protected $condition = "";
15 protected $variables = [];
16 protected $rule = "";
17
23 public function process($sefRule)
24 {
25 $this->rule = "";
26 $this->variables = [];
27 $this->condition = "#^" . preg_replace_callback("/(#[a-zA-Z0-9_]+#)/", [$this, "_callback"], $sefRule) . "\\??(.*)#";
28 $i = 0;
29 foreach ($this->variables as $variableName)
30 {
31 $i++;
32 if ($this->rule)
33 {
34 $this->rule .= "&";
35 }
36 $this->rule .= $variableName . "=\$" . $i;
37 }
38 $i++;
39 $this->rule .= "&\$" . $i;
40 }
41
47 public function getCondition()
48 {
49 return $this->condition;
50 }
51
57 public function getRule()
58 {
59 return $this->rule;
60 }
61
69 protected function _callback(array $match)
70 {
71 $this->variables[] = trim($match[0], "#");
72 if (str_ends_with($match[0], "_PATH#"))
73 {
74 return "(.+?)";
75 }
76 return "([^/]+?)";
77 }
78}
_callback(array $match)
Определения UrlRewriterRuleMaker.php:69
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$i
Определения factura.php:643