|
|
@@ -14,9 +14,15 @@ trait ConfigTrait
|
|
|
public function getConfig(string $key = null): mixed
|
|
|
{
|
|
|
if (empty($this->options)) {
|
|
|
- $extensionID = explode('\\', static::class)[2];
|
|
|
- $this->options = $this->extensionManager->getExtensionConfig($extensionID);
|
|
|
+ if (!method_exists($this, 'getExtensionID')) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ $this->options = $this->extensionManager->getExtensionConfig($this->getExtensionID());
|
|
|
}
|
|
|
return $key ? ($this->options[$key] ?? null) : $this->options;
|
|
|
}
|
|
|
+ public function __get(string $name): mixed
|
|
|
+ {
|
|
|
+ return $this->getConfig($name);
|
|
|
+ }
|
|
|
}
|