1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
classtemplate.php
См. документацию.
1<?php
2
4
6
7final class ClassTemplate implements Template
8{
9 public function __construct(
10 private readonly string $className,
11 )
12 {}
13
14 public function getContent(): string
15 {
16 return <<<PHP
17<?php
18
19if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true)
20{
21 die();
22}
23
24class {$this->className} extends CBitrixComponent
25{
26 public function onPrepareComponentParams(\$arParams): array
27 {
28 // TODO: prepare or format component params
29 \$arParams['USERNAME'] ??= 'default value';
30
31 return \$arParams;
32 }
33
34 public function executeComponent(): void
35 {
36 \$this->prepareResult();
37
38 \$this->includeComponentTemplate();
39 }
40
41 private function prepareResult(): void
42 {
43 // TODO: prepare result for template.php
44 \$this->arResult['FRUITS'] = [
45 'apple',
46 'banana',
47 'ananas',
48 ];
49 }
50}
51
52PHP;
53 }
54}
$arParams
Определения access_dialog.php:21
__construct(private readonly string $className,)
Определения classtemplate.php:9
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
die
Определения quickway.php:367