oms-Profile/Theme/Backend/Components/AccountGroupSelector/BaseView.php
2024-03-20 07:21:24 +00:00

96 lines
1.9 KiB
PHP
Executable File

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Profile
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Profile\Theme\Backend\Components\AccountGroupSelector;
use phpOMS\Localization\L11nManager;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
/**
* Component view.
*
* @package Modules\Profile
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
* @codeCoverageIgnore
*/
class BaseView extends View
{
/**
* Dom id
*
* @var string
* @since 1.0.0
*/
public string $id = '';
/**
* Is required?
*
* @var bool
* @since 1.0.0
*/
public bool $isRequired = false;
/**
* Dom name
*
* @var string
* @since 1.0.0
*/
public string $name = '';
/**
* {@inheritdoc}
*/
public function __construct(L11nManager $l11n, RequestAbstract $request, ResponseAbstract $response)
{
parent::__construct($l11n, $request, $response);
$this->setTemplate('/Modules/Profile/Theme/Backend/Components/AccountGroupSelector/base');
$view = new PopupView($l11n, $request, $response);
$this->addData('popup', $view);
}
/**
* Is required?
*
* @return bool
*
* @since 1.0.0
*/
public function isRequired() : bool
{
return $this->isRequired;
}
/**
* {@inheritdoc}
*/
public function render(mixed ...$data) : string
{
/** @var array{0:string, 1:string, 2:null|bool} $data */
$this->id = $data[0];
$this->name = $data[1];
$this->isRequired = $data[2] ?? false;
$this->data['popup']->id = $this->id;
return parent::render();
}
}