This commit is contained in:
philipp lang 2024-02-03 22:58:25 +01:00
parent 8bf65ffb00
commit 9be929ba87
3 changed files with 17 additions and 28 deletions

View File

@ -4,18 +4,4 @@ namespace Silva\Adrema\Components;
class EventIndex extends EventManager
{
public function componentDetails()
{
return [
'name' => __('event_index_component_name'),
'description' => __('event_index_component_description'),
];
}
public function onRun()
{
$this->addAssets();
$this->loadSettings();
$this->loadSingleEvent();
}
}

View File

@ -15,6 +15,23 @@ abstract class EventManager extends ComponentBase
public ?array $event;
public string $currentUrl;
public function componentDetails()
{
$componentName = str(class_basename(static::class))->snake();
return [
'name' => __("{$componentName}_component_name"),
'description' => __("{$componentName}_component_description"),
];
}
public function onRun()
{
$this->addAssets();
$this->loadSettings();
$this->loadSingleEvent();
}
protected function addAssets(): void
{
// $this->addJs('assets/vendor/adrema-form/dist/main.js');

View File

@ -4,18 +4,4 @@ namespace Silva\Adrema\Components;
class EventRegister extends EventManager
{
public function componentDetails()
{
return [
'name' => __('event_register_component_name'),
'description' => __('event_register_component_description'),
];
}
public function onRun()
{
$this->addAssets();
$this->loadSettings();
$this->loadSingleEvent();
}
}