Добавил namespace и зависимости

This commit is contained in:
CORP\phedor 2018-03-27 17:40:33 +03:00
parent e9f7c23990
commit 32ec09a66a
92 changed files with 454 additions and 128 deletions

View file

@ -3,6 +3,13 @@
/**
* Расширения для PHPTAL для отображения времени и даты
*/
namespace ctiso;
use PHPTAL_Php_TalesInternal,
ctiso\Controller\Site,
ctiso\Controller\Component,
ctiso\HttpRequest,
PHPTAL_TalesRegistry;
class DateTime_Tales implements PHPTAL_Tales
{
static public function date($expression, $nothrow = false)
@ -48,10 +55,10 @@ class Tales {
/*.Controller_Component.*/$component = null;
if (class_exists("Controller_Site")) { //Если мы в CMS2
$component = Controller_Site::loadComponent($expression);
$component = Site::loadComponent($expression);
} else {
global $db, $registry; // Иначе обращаемся к глобальным переменным
$component = Controller_Component::loadComponent($expression, $db, $registry);
$component = Component::loadComponent($expression, $db, $registry);
}
$req = new HttpRequest();