public static function init() { global $infra, $infrajs; Event::handler('oninit', function () { //session и template global $infra_template_scope; $fn = function ($name, $value) { return unick::find($name, $value); }; Sequence::set($infra_template_scope, Sequence::right('infrajs.find'), $fn); Sequence::set($infra_template_scope, Sequence::right('infrajs.unicks'), unick::$unicks); }); }
<?php namespace infrajs\controller; use infrajs\path\Path; use infrajs\event\Event; Event::handler('oninit', function () { ext\unick::init(); }); Event::handler('layer.oninit:external', function (&$layer) { ext\unick::check($layer); }, 'unick');