Exemplo n.º 1
0
 function __construct(Route $route, $file = null, $vars = null, $devTemplate = true, $devJs = true, $devCss = true, $devImg = false, Di $di, $httpMtime = false, $httpEtag = false, $httpExpireTime = false)
 {
     parent::__construct($file, $vars, $devTemplate, $devJs, $devCss, $devImg, $di, $httpMtime, $httpEtag, $httpExpireTime);
     $this['route'] = $route;
     $this->onCompile(function ($tml) use($route) {
         $tml('a')->each(function ($a) use($route) {
             $a->href = $route->resolveRoute($a->href);
         });
     });
 }
Exemplo n.º 2
0
 function __construct($file = null, $vars = null, $devTemplate = true, $devJs = true, $devCss = true, $devImg = false, Di $di, Translator $Translator = null, $server = null, $cdnSubdomain = null, $langDefault = null)
 {
     parent::__construct($file, $vars, $devTemplate, $devJs, $devCss, $devImg, $di);
     $this->di = $di;
     if (!$server) {
         $server =& $_SERVER;
     }
     $this->Translator = $Translator;
     $this->server = $server;
     $this->langDefault = $langDefault;
     $this->cdnSubdomain = $cdnSubdomain;
 }
Exemplo n.º 3
0
 function __construct(Route $route, User $user, $file = null, $vars = null, $devTemplate = true, $devJs = true, $devCss = true, $devImg = false, Di $di, $httpMtime = false, $httpEtag = false, $httpExpireTime = false)
 {
     parent::__construct($file, $vars, $devTemplate, $devJs, $devCss, $devImg, $di, $httpMtime, $httpEtag, $httpExpireTime);
     $this['route'] = $route;
     $this['user'] = $user;
     $this->onCompile(function ($tml) use($route) {
         $tml('body')->attr(['data-route--root' => $route->rootUrl(), 'data-route--branch' => '<?=$route->branchUrl()?>', 'data-route--id' => '<?=$route->branchLevelId()?>', 'data-user--id' => '<?=$user->id?>']);
         $tml('a')->each(function ($a) use($route) {
             $a->href = $route->resolveRoute($a->href);
         });
         $tml('form')->each(function ($a) use($route) {
             $a->action = $route->resolveRoute($a->action);
         });
     });
 }