Added Module Config Handler

This commit is contained in:
Florian Bouillon 2019-05-07 14:30:44 +02:00
parent 0d36c51ad2
commit 4abe7447bd
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,51 @@
<?php
namespace DeltaCMS\Module\Config;
use DeltaCMS\Module\Config\ConfigInterface;
class Config implements ConfigInterface
{
public function __construct(?ConfigInterface $config = null)
{
if (isset($config)) {
$this->routes = $config->getRoutes();
$this->templateFolder = $config->getTemplateFolder();
}
}
private $routes = array();
private $templateFolder = "";
private $forms = array();
public function getRoutes(): array
{
return $this->routes;
}
public function setRoutes(array $routes)
{
$this->routes = $routes;
}
public function getTemplateFolder(): string
{
return $this->templateFolder;
}
public function setTemplateFolder(string $folder)
{
$this->templateFolder = $folder;
}
public function getForms(): array
{
return $this->forms;
}
public function setForms(array $forms)
{
$this->forms = $forms;
}
}

View File

@ -7,4 +7,6 @@ interface ConfigInterface
public function getRoutes(): array;
public function getTemplateFolder(): string;
public function getForms(): array;
}