fix: Доп. проверки значений
This commit is contained in:
parent
33565c9f7e
commit
b20ea0e7dc
8 changed files with 45 additions and 39 deletions
|
|
@ -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
32
src/View/FakeTemplate.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -71,6 +71,6 @@ class Plain extends \stdClass
|
|||
include ($document);
|
||||
$content = ob_get_contents ();
|
||||
ob_clean ();
|
||||
return $content;
|
||||
return $content === false ? '' : $content;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue