fix
This commit is contained in:
parent
7d35a8f3f0
commit
a09fc396d8
9 changed files with 30 additions and 32 deletions
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace ctiso\Controller;
|
||||
use ctiso\Shortcut,
|
||||
Exception,
|
||||
use Exception,
|
||||
ctiso\Path,
|
||||
ctiso\Url,
|
||||
ctiso\Model\Factory,
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class Component
|
|||
|
||||
$tpl->set('common', Path::join($this->config->get('system', 'web'), '../', 'common'));
|
||||
$tpl->set('script', Path::join($this->config->get('system', 'web'), 'js'));
|
||||
$tpl->set('media', Path::join($this->config->get('system', 'templates_web'), $template));
|
||||
$tpl->set('media', Path::join($this->config->get('system', 'web'), 'templates', $template));
|
||||
|
||||
if ($default) {
|
||||
$tpl->set('site_template', $this->config->get('site', 'web') . '/templates/' . $default);
|
||||
|
|
@ -244,13 +244,13 @@ class Component
|
|||
}
|
||||
$name = $path;
|
||||
|
||||
$path = Path::join ($site->config->get('site', 'path'), 'components', $name, $name . '.php');
|
||||
$className = 'Component_' . $name;
|
||||
$path = Path::join ($site->config->get('site', 'components'), $name, $name . '.php');
|
||||
$className = 'Components\\'. ucfirst($name). '\\' . $name;
|
||||
|
||||
$component/*: Component*/ = null;
|
||||
|
||||
if (file_exists($path)) {
|
||||
require_once ($path);
|
||||
// require_once ($path);
|
||||
$component = new $className();
|
||||
|
||||
$component->viewPath = array($site->config->get('site', 'path') . '/components/' . $name . '/');
|
||||
|
|
@ -258,8 +258,6 @@ class Component
|
|||
$component->COMPONENTS_WEB = $site->config->get('site', 'web') . '/components/';
|
||||
|
||||
} else {
|
||||
$path = Path::join ($site->config->get('system', 'components'), $name, $name . '.php');
|
||||
require_once ($path);
|
||||
$component = new $className();
|
||||
|
||||
$template = $component->getTemplateName($registry);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue