fix: Доп. проверки значений

This commit is contained in:
origami11@yandex.ru 2025-11-12 19:41:24 +03:00
parent 33565c9f7e
commit b20ea0e7dc
8 changed files with 45 additions and 39 deletions

View file

@ -1,8 +1,9 @@
<?php
namespace ctiso\View;
use ctiso\View\View,
PHPTAL;
use ctiso\View\View;
use PHPTAL;
use PHPTAL_TranslationService;
class Composite extends View

32
src/View/FakeTemplate.php Normal file
View file

@ -0,0 +1,32 @@
<?php
namespace ctiso\View;
class FakeTemplate extends \stdClass {
/** @var array */
public $_data = [];
/** @var string */
public $_name = '';
/**
* @param string $name
*/
function __construct($name) {
$this->_name = $name;
}
/**
* @param string $key
* @param mixed $value
*/
function __set($key, $value): void {
$this->_data[$key] = $value;
}
/**
* @return string
*/
function execute() {
return json_encode($this->_data);
}
}

View file

@ -71,6 +71,6 @@ class Plain extends \stdClass
include ($document);
$content = ob_get_contents ();
ob_clean ();
return $content;
return $content === false ? '' : $content;
}
}