1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
classtemplate.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Cli\Command\Make\Templates\Component
;
4
5
use
Bitrix\Main\Cli\Helper\Renderer\Template
;
6
7
final
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
19
if
(!defined(
'B_PROLOG_INCLUDED'
) || B_PROLOG_INCLUDED !==
true
)
20
{
21
die
();
22
}
23
24
class
{$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
52
PHP;
53
}
54
}
$arParams
$arParams
Определения
access_dialog.php:21
Bitrix\Main\Cli\Command\Make\Templates\Component\ClassTemplate
Определения
classtemplate.php:8
Bitrix\Main\Cli\Command\Make\Templates\Component\ClassTemplate\__construct
__construct(private readonly string $className,)
Определения
classtemplate.php:9
Bitrix\Main\Cli\Command\Make\Templates\Component\ClassTemplate\getContent
getContent()
Определения
classtemplate.php:14
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main\Cli\Helper\Renderer\Template
Определения
template.php:6
Bitrix\Main\Cli\Command\Make\Templates\Component
Определения
classtemplate.php:3
die
die
Определения
quickway.php:367
bitrix
modules
main
lib
cli
command
make
templates
component
classtemplate.php
Создано системой
1.14.0