Fix serialization

This commit is contained in:
Dennis Eichhorn 2016-08-11 17:26:55 +02:00
parent 62628c40b5
commit 8c4c6bf03c

View File

@ -324,7 +324,7 @@ class View implements \Serializable
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getText(string $translation, string $module = null, string $theme = null)
private function getText(string $translation, string $module = null, string $theme = null)
{
if (!isset($module)) {
$match = '/Modules/';
@ -407,13 +407,19 @@ class View implements \Serializable
/**
* Serialize view for rendering.
*
* @return string
* @return string|array
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function serialize()
{
$path = realpath($oldPath = __DIR__ . '/../..' . $this->template . '.tpl.php');
if ($path === false || StringUtils::startsWith($path, ROOT_PATH) === false) {
return $this->toArray();
}
return $this->render();
}