1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
renderer.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\UI\Viewer\Renderer;
4
5use Bitrix\Main\ArgumentException;
6use Bitrix\Main\Web\Uri;
7
8abstract class Renderer
9{
10 const JS_TYPE_UNKNOWN = 'unknown';
11
12 protected $name;
14 protected $sourceUri;
16 protected $options;
17
18 public function __construct($name, Uri $sourceUri, array $options = [])
19 {
20 $this->name = $name;
21 $this->sourceUri = $sourceUri;
22 $this->options = $options;
23 }
24
25 public function getOption($name, $defaultValue = null)
26 {
27 $value = $this->getByPath($this->options, $name, $defaultValue);
28 if ($value instanceof \Closure)
29 {
30 return $value();
31 }
32
33 return $value;
34 }
35
45 private function getByPath($array, $path, $defaultValue = null)
46 {
47 if(!is_array($array) && !$array instanceof \ArrayAccess)
48 {
49 throw new ArgumentException("\$array is not array or don't implement ArrayAccess");
50 }
51
52 $pathItems = explode('.', $path);
53
54 $lastArray = $array;
55 foreach($pathItems as $pathItem)
56 {
57 if(!is_array($lastArray) && !$lastArray instanceof \ArrayAccess)
58 {
59 return $defaultValue;
60 }
61
62 if(!isset($lastArray[$pathItem]))
63 {
64 return $defaultValue;
65 }
66
67 $lastArray = $lastArray[$pathItem];
68 }
69
70 return $lastArray;
71 }
72
73 public static function getAllowedContentTypes()
74 {
75 return [];
76 }
77
78 public static function getJsType()
79 {
80 return self::JS_TYPE_UNKNOWN;
81 }
82
83 public static function getSizeRestriction()
84 {
85 return null;
86 }
87
88 abstract public function render();
89
90 public function getData()
91 {
92 return null;
93 }
94}
$path
Определения access_edit.php:21
if($_SERVER $defaultValue['REQUEST_METHOD']==="GET" &&!empty($RestoreDefaults) && $bizprocPerms==="W" &&check_bitrix_sessid())
Определения options.php:32
static getAllowedContentTypes()
Определения renderer.php:73
__construct($name, Uri $sourceUri, array $options=[])
Определения renderer.php:18
static getSizeRestriction()
Определения renderer.php:83
getOption($name, $defaultValue=null)
Определения renderer.php:25
Определения uri.php:17
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804