Версия полностью совместимая c CMS

This commit is contained in:
origami11 2017-02-17 17:31:17 +03:00
parent 7ce493414e
commit 75bb35d5bf
21 changed files with 1404 additions and 783 deletions

View file

@ -1,36 +1,37 @@
<?php
/**
* @package system.view
*/
// CompositeView+PHPTAL
class View_Composite extends View_Top
// View_Base + PHPTAL = View_Template (View_Composite)
class View_Composite extends View_View
{
private $tal;
function __construct($file)
{
parent::__construct($file);
parent::__construct();
$this->tal = new PHPTAL($file);
$this->tal->setPhpCodeDestination(PHPTAL_PHP_CODE_DESTINATION);
$this->tal->setEncoding(PHPTAL_DEFAULT_ENCODING); // PHPTAL_DEFAULT_ENCODING !!
$this->tal->setTemplateRepository(PHPTAL_TEMPLATE_REPOSITORY);
$this->tal->setOutputMode(PHPTAL::HTML5);
$this->tal->stripComments(true);
// $this->tal->addPreFilter(new PHPTAL_PreFilter_Normalize());
}
function set($key, $val)
{
function set($key, $val) {
if ($key == 'title') {
$this->setTitle($val);
}
$this->tal->set($key, $val);
}
function __set($key, $val)
{
function __set($key, $val) {
$this->tal->set($key, $val);
}
function setTranslator($tr)
{
$this->tal->setTranslator($tr);
}
function execute()
{
parent::execute();