Created
June 22, 2023 08:42
-
-
Save luckydevilru/8dc419f497c7f336fc0dde8c130d5373 to your computer and use it in GitHub Desktop.
component class bitrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { | |
die(); | |
} | |
class AgileUsersTablesComponent extends \CBitrixComponent | |
{ | |
public function onPrepareComponentParams($arParams) | |
{ | |
return $arParams; | |
} | |
public function collectData() | |
{ | |
$this->arResult = ['data' => date('Y-m-d')]; | |
} | |
public function executeComponent() | |
{ | |
try { | |
$this->checkModules(); | |
$this->collectData(); | |
$this->includeComponentTemplate(); | |
} catch (\Exception $e) { | |
$this->arResult["ERROR"] = $e->getMessage(); | |
ShowError($e->getMessage()); | |
} | |
return $this->arResult; | |
} | |
private function checkModules() | |
{ | |
if (!\Bitrix\Main\Loader::includeModule("iblock")) { | |
throw new \Bitrix\Main\SystemException("Модуль iblock не установлен"); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment