Интерфейс вместо класса Site
This commit is contained in:
parent
c2b9254fd0
commit
df00756a41
5 changed files with 22 additions and 8 deletions
|
|
@ -13,7 +13,7 @@ use ctiso\HttpRequest,
|
|||
ctiso\Database\PDOStatement,
|
||||
ctiso\Collection,
|
||||
ctiso\Registry,
|
||||
App\Controller\Site,
|
||||
ctiso\Controller\SiteInterface,
|
||||
PHPTAL,
|
||||
PHPTAL_PreFilter_Normalize;
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ class Component
|
|||
$view->component_title = $settings['title'];
|
||||
}
|
||||
|
||||
static function loadComponent($expression, /*.Site.*/ $site)
|
||||
static function loadComponent($expression, /*.SiteInterface.*/ $site)
|
||||
{
|
||||
|
||||
$expression = htmlspecialchars_decode($expression);
|
||||
|
|
@ -251,7 +251,7 @@ class Component
|
|||
}
|
||||
}
|
||||
|
||||
$db = $site->db;
|
||||
$db = $site->getDatabase();
|
||||
|
||||
$component->db = $db;
|
||||
$component->config = $site->config;
|
||||
|
|
|
|||
11
src/Controller/SiteInterface.php
Normal file
11
src/Controller/SiteInterface.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace ctiso\Controller;
|
||||
|
||||
interface SiteInterface {
|
||||
function loadComponent($expression);
|
||||
function getDatabase();
|
||||
function getConfig();
|
||||
function setComponentConfig($config);
|
||||
function addRequireJsPath($name, $path, $schim = null);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue