mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 17:52:41 +01:00
Avoid adding languages to data
property of Site
class
This commit is contained in:
parent
fa835fbd0a
commit
c3b01f135b
@ -265,7 +265,7 @@ class Formwork
|
||||
FileSystem::assert(CONFIG_PATH . 'site.yml');
|
||||
$config = YAML::parseFile(CONFIG_PATH . 'site.yml');
|
||||
$this->site = new Site($config);
|
||||
$this->site->set('languages', $this->languages);
|
||||
$this->site->setLanguages($this->languages);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Formwork\Core;
|
||||
|
||||
use Formwork\Languages\Languages;
|
||||
use Formwork\Metadata\Metadata;
|
||||
use Formwork\Utils\FileSystem;
|
||||
use RuntimeException;
|
||||
@ -29,6 +30,13 @@ class Site extends AbstractPage
|
||||
*/
|
||||
protected $templates = [];
|
||||
|
||||
/**
|
||||
* Site languages
|
||||
*
|
||||
* @var Languages
|
||||
*/
|
||||
protected $languages;
|
||||
|
||||
/**
|
||||
* Create a new Site instance
|
||||
*/
|
||||
@ -143,6 +151,14 @@ class Site extends AbstractPage
|
||||
return $this->currentPage = $this->findPage($route);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set site languages
|
||||
*/
|
||||
public function setLanguages(Languages $languages): void
|
||||
{
|
||||
$this->languages = $languages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get site index page
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user