Прохождение автризации
This commit is contained in:
parent
aaa9c2e1bf
commit
c2b9254fd0
9 changed files with 16 additions and 14 deletions
|
|
@ -110,8 +110,8 @@ class Action
|
|||
{
|
||||
$file = $name . self::TEMPLATE_EXTENSION;
|
||||
|
||||
$basePath = $this->config->get('site', 'path');
|
||||
$webPath = $this->config->get('site', 'web');
|
||||
$basePath = $this->config->get('system', 'path');
|
||||
$webPath = $this->config->get('system', 'web');
|
||||
|
||||
$list = array(
|
||||
Path::join($this->modulePath, 'templates', $this->viewPathPrefix) => Path::join($webPath, "modules", $this->name, 'templates', $this->viewPathPrefix),
|
||||
|
|
@ -125,6 +125,7 @@ class Action
|
|||
}
|
||||
|
||||
/*.Composite.*/$tpl = new $viewClass($template);
|
||||
$tpl->config = $this->config;
|
||||
|
||||
$stylePath = Path::join($webPath, "assets", "css");
|
||||
$iconsPath = Path::join($webPath, 'icons');
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use Exception;
|
|||
|
||||
class File {
|
||||
static function getContents($filename) {
|
||||
$buffer = file_get_contents($filename);
|
||||
$buffer = @file_get_contents($filename);
|
||||
if ($buffer !== false) {
|
||||
return $buffer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class ActionLogger
|
|||
function __construct(/*.Filter.*/$processor, $logPath, $user) {
|
||||
$this->processor = $processor;
|
||||
$this->user = $user;
|
||||
|
||||
$file = fopen($logPath, "a");
|
||||
if (is_resource($file)) {
|
||||
$this->file = $file;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace ctiso\Model;
|
||||
use ctiso\Settings,
|
||||
use ctiso\Registry,
|
||||
ctiso\Database;
|
||||
|
||||
class Factory
|
||||
{
|
||||
static $shortcut = "model";
|
||||
public $db;
|
||||
public $_registry;
|
||||
public $config;
|
||||
|
||||
public function __construct (/*.Database.*/ $db, Settings $_registry = null)
|
||||
public function __construct (Database $db, Registry $config = null)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->_registry = $_registry;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -27,7 +27,7 @@ class Factory
|
|||
$model = new $modelName();
|
||||
$model->db = $this->db;
|
||||
$model->factory = $this;
|
||||
$model->_registry = $this->_registry;
|
||||
$model->config = $this->config;
|
||||
$model->setUp();
|
||||
//
|
||||
return $model;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use ctiso\File,
|
|||
|
||||
class Settings
|
||||
{
|
||||
public $data;
|
||||
public $data = [];
|
||||
protected $file;
|
||||
protected $format = 'php';
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ class Url {
|
|||
}
|
||||
|
||||
function toString() {
|
||||
return '?' . http_build_query(array_merge($this->parts, $this->parent->parts));
|
||||
return '?' . http_build_query(array_merge($this->parts, $this->parent ? $this->parent->parts : []));
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ use ctiso\View\View,
|
|||
class Composite extends View
|
||||
{
|
||||
private $tal;
|
||||
public $config;
|
||||
|
||||
function __construct($file)
|
||||
{
|
||||
|
|
@ -18,7 +19,7 @@ class Composite extends View
|
|||
|
||||
$this->tal = new PHPTAL($file);
|
||||
$this->tal->setPhpCodeDestination(PHPTAL_PHP_CODE_DESTINATION);
|
||||
$this->tal->setEncoding(PHPTAL_DEFAULT_ENCODING); // PHPTAL_DEFAULT_ENCODING !!
|
||||
$this->tal->setEncoding(PHPTAL_DEFAULT_ENCODING);
|
||||
$this->tal->setTemplateRepository(PHPTAL_TEMPLATE_REPOSITORY);
|
||||
$this->tal->setOutputMode(PHPTAL::HTML5);
|
||||
$this->tal->stripComments(true);
|
||||
|
|
@ -39,7 +40,6 @@ class Composite extends View
|
|||
function execute()
|
||||
{
|
||||
parent::execute();
|
||||
// postProcess
|
||||
return $this->tal->execute();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class Top extends Composite {
|
|||
$this->set('deps', implode(",", array_values($this->require)));
|
||||
|
||||
$this->set('title', $this->getTitle());
|
||||
$this->set('jspath', enableHttps($this->config->get('system', 'web')));
|
||||
$this->set('jspath', $this->config->get('system', 'web'));
|
||||
//
|
||||
return $this->execute(); // execute+phptal ??
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,4 +205,4 @@ class View
|
|||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue