Example #1
0
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('include', array($me, 'macroInclude'));
     $me->addMacro('includeblock', array($me, 'macroIncludeBlock'));
     $me->addMacro('extends', array($me, 'macroExtends'));
     $me->addMacro('layout', array($me, 'macroExtends'));
     $me->addMacro('block', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('#', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('define', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('snippet', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('ifset', array($me, 'macroIfset'), 'endif');
     $me->addMacro('widget', array($me, 'macroControl'));
     // deprecated - use control
     $me->addMacro('control', array($me, 'macroControl'));
     $me->addMacro('href', NULL, NULL, function (MacroNode $node, PhpWriter $writer) use($me) {
         return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php ';
     });
     $me->addMacro('plink', array($me, 'macroLink'));
     $me->addMacro('link', array($me, 'macroLink'));
     $me->addMacro('ifCurrent', array($me, 'macroIfCurrent'), 'endif');
     // deprecated; use n:class="$presenter->linkCurrent ? ..."
     $me->addMacro('contentType', array($me, 'macroContentType'));
     $me->addMacro('status', array($me, 'macroStatus'));
 }
Example #2
0
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('link', [$me, 'macroLink']);
     $me->addMacro('plink', [$me, 'macroLink']);
     $me->addMacro('href', NULL, NULL, function (MacroNode $node, PhpWriter $writer) use($me) {
         return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php ';
     });
 }
Example #3
0
 /**
  * @param \Latte\Compiler $compiler
  * @return \Latte\Macros\MacroSet
  */
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('href', NULL, NULL, function (\Latte\MacroNode $node, \Latte\PhpWriter $writer) use($me) {
         return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php ';
     });
     $me->addMacro('plink', [$me, 'macroLink']);
     $me->addMacro('link', [$me, 'macroLink']);
     $me->addMacro('ifAllowed', [$me, 'macroIfAllowed'], '}');
     return $me;
 }
Example #4
0
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('control', [$me, 'macroControl']);
     $me->addMacro('href', NULL, NULL, function (MacroNode $node, PhpWriter $writer) use($me) {
         return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php ';
     });
     $me->addMacro('plink', [$me, 'macroLink']);
     $me->addMacro('link', [$me, 'macroLink']);
     $me->addMacro('ifCurrent', [$me, 'macroIfCurrent'], '}');
     // deprecated; use n:class="$presenter->linkCurrent ? ..."
 }
Example #5
0
 public static function install(Latte\Parser $parser)
 {
     $me = new static($parser);
     $me->addMacro('include', array($me, 'macroInclude'));
     $me->addMacro('includeblock', array($me, 'macroIncludeBlock'));
     $me->addMacro('extends', array($me, 'macroExtends'));
     $me->addMacro('layout', array($me, 'macroExtends'));
     $me->addMacro('block', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('define', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('snippet', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('ifset', array($me, 'macroIfset'), 'endif');
     $me->addMacro('widget', array($me, 'macroControl'));
     $me->addMacro('control', array($me, 'macroControl'));
     $me->addMacro('@href', function (MacroNode $node, $writer) use($me) {
         return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php ';
     });
     $me->addMacro('plink', array($me, 'macroLink'));
     $me->addMacro('link', array($me, 'macroLink'));
     $me->addMacro('ifCurrent', array($me, 'macroIfCurrent'), 'endif');
     // deprecated; use n:class="$presenter->linkCurrent ? ..."
     $me->addMacro('contentType', array($me, 'macroContentType'));
     $me->addMacro('status', '$netteHttpResponse->setCode(%node.args)');
 }
Example #6
0
RE_IDENTIFIER='[_a-zA-Z\x7F-\xFF][_a-zA-Z0-9\x7F-\xFF]*';private$namedBlocks=array();private$extends;static
function
install(Latte\Compiler$compiler){$me=new
static($compiler);$me->addMacro('include',array($me,'macroInclude'));$me->addMacro('includeblock',array($me,'macroIncludeBlock'));$me->addMacro('extends',array($me,'macroExtends'));$me->addMacro('layout',array($me,'macroExtends'));$me->addMacro('block',array($me,'macroBlock'),array($me,'macroBlockEnd'));$me->addMacro('define',array($me,'macroBlock'),array($me,'macroBlockEnd'));$me->addMacro('snippet',array($me,'macroBlock'),array($me,'macroBlockEnd'));$me->addMacro('ifset',array($me,'macroIfset'),'endif');$me->addMacro('widget',array($me,'macroControl'));$me->addMacro('control',array($me,'macroControl'));$me->addMacro('href',NULL,NULL,function(MacroNode$node,PhpWriter$writer)use($me){return' ?> href="<?php '.$me->macroLink($node,$writer).' ?>"<?php ';});$me->addMacro('plink',array($me,'macroLink'));$me->addMacro('link',array($me,'macroLink'));$me->addMacro('ifCurrent',array($me,'macroIfCurrent'),'endif');$me->addMacro('contentType',array($me,'macroContentType'));$me->addMacro('status',array($me,'macroStatus'));}function
Example #7
0
 static function install(Latte\Parser $parser)
 {
     $me = new static($parser);
     $me->addMacro('include', array($me, 'macroInclude'));
     $me->addMacro('includeblock', array($me, 'macroIncludeBlock'));
     $me->addMacro('extends', array($me, 'macroExtends'));
     $me->addMacro('layout', array($me, 'macroExtends'));
     $me->addMacro('block', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('define', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('snippet', array($me, 'macroBlock'), array($me, 'macroBlockEnd'));
     $me->addMacro('ifset', array($me, 'macroIfset'), 'endif');
     $me->addMacro('widget', array($me, 'macroControl'));
     $me->addMacro('control', array($me, 'macroControl'));
     $me->addMacro('@href', function (MacroNode $node, $writer) use($me) {
         return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php ';
     });
     $me->addMacro('plink', array($me, 'macroLink'));
     $me->addMacro('link', array($me, 'macroLink'));
     $me->addMacro('ifCurrent', array($me, 'macroIfCurrent'), 'endif');
     $me->addMacro('contentType', array($me, 'macroContentType'));
     $me->addMacro('status', array($me, 'macroStatus'));
 }