Example #1
0
        //Мы не можем делать проверку пока другой плагин не подменит tpl
        $res = Load::loadTEXT($layer['tpl']);
        if (!$res) {
            return false;
        }
    }
}, 'tplcheck:is');
Event::handler('Layer.isshow', function (&$layer) {
    //tpl depricated
    if (Layer::pop($layer, 'onlyclient')) {
        return;
    }
    return Tpl::jsoncheck($layer);
}, 'jsoncheck:is');
Run::runAddKeys('childs');
Run::runAddList('child');
Event::handler('Layer.oninit', function () {
    $root = Crumb::getInstance();
    if (!$root->is) {
        throw new \Exception('Crumb нужно инициализировать до запуска контроллера');
    }
    Sequence::set(Template::$scope, Sequence::right('infra.Crumb.query'), $root->query);
    Sequence::set(Template::$scope, Sequence::right('infra.Crumb.params'), Crumb::$params);
    Sequence::set(Template::$scope, Sequence::right('infra.Crumb.get'), Crumb::$get);
    $cl = function ($mix = null) {
        return ext\Crumb::getInstance($mix);
    };
    Sequence::set(Template::$scope, Sequence::right('infra.Crumb.getInstance'), $cl);
    External::add('child', 'layers');
    External::add('crumb', function (&$now, &$ext, &$layer, &$external, $i) {
        //проверка external в onchange