1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
base.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Rest\Url
;
4
5
use \Bitrix\Main\Web\Uri;
6
7
class
Base
8
{
9
protected
$directory
=
''
;
10
protected
$pages
= [];
11
protected
static
$instance
;
12
13
final
public
static
function
getInstance
()
14
{
15
if
(!isset(static::$instance))
16
{
17
static::$instance =
new
static
();
18
}
19
return
static::$instance;
20
}
21
22
protected
function
getDir
()
23
{
24
return
SITE_DIR
.$this->directory;
25
}
26
27
protected
function
getReplaced
(
string
$url
, $replace =
null
, $subject =
null
)
28
{
29
if
(!is_null($replace) && !is_null($subject))
30
{
31
$url
= str_replace($replace, $subject,
$url
);
32
}
33
34
return
$url
;
35
}
36
37
protected
function
addParams
(
$url
,
$params
)
38
{
39
if
(is_array(
$params
))
40
{
41
$uri
=
new
Uri
(
$url
);
42
$uri
->addParams(
$params
);
43
$url
=
$uri
->getUri();
44
}
45
46
return
$url
;
47
}
48
49
protected
function
getUrl
(
$page
, $replace =
null
, $subject =
null
,
$query
=
null
)
50
{
51
$url
=
null
;
52
if
(array_key_exists(
$page
, $this->pages))
53
{
54
$url
= $this->
getDir
().$this->pages[
$page
];
55
56
if
(!is_null($replace) && !is_null($subject))
57
{
58
$url
= $this->
getReplaced
(
$url
, $replace, $subject);
59
}
60
$url
= $this->
getReplaced
(
$url
,
'//'
,
'/'
);
61
62
if
(is_array(
$query
))
63
{
64
$url
= $this->
addParams
(
$url
,
$query
);
65
}
66
}
67
68
return
$url
;
69
}
70
71
}
Bitrix\Main\Web\Uri
Определения
uri.php:17
Bitrix\Rest\Url\Base
Определения
base.php:8
Bitrix\Rest\Url\Base\addParams
addParams($url, $params)
Определения
base.php:37
Bitrix\Rest\Url\Base\$directory
$directory
Определения
base.php:9
Bitrix\Rest\Url\Base\$pages
$pages
Определения
base.php:10
Bitrix\Rest\Url\Base\getReplaced
getReplaced(string $url, $replace=null, $subject=null)
Определения
base.php:27
Bitrix\Rest\Url\Base\getUrl
getUrl($page, $replace=null, $subject=null, $query=null)
Определения
base.php:49
Bitrix\Rest\Url\Base\getDir
getDir()
Определения
base.php:22
Bitrix\Rest\Url\Base\getInstance
static getInstance()
Определения
base.php:13
Bitrix\Rest\Url\Base\$instance
static $instance
Определения
base.php:11
$query
$query
Определения
get_search.php:11
$uri
if(file_exists($_SERVER['DOCUMENT_ROOT'] . "/urlrewrite.php")) $uri
Определения
urlrewrite.php:61
SITE_DIR
const SITE_DIR(!defined('LANG'))
Определения
include.php:72
Bitrix\Rest\Url
Определения
base.php:3
$page
$page
Определения
order_form.php:33
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
$url
$url
Определения
iframe.php:7
bitrix
modules
rest
lib
url
base.php
Создано системой
1.14.0