本文整理汇总了PHP中static::addMacro方法的典型用法代码示例。如果您正苦于以下问题:PHP static::addMacro方法的具体用法?PHP static::addMacro怎么用?PHP static::addMacro使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类static
的用法示例。
在下文中一共展示了static::addMacro方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
public static function install(Latte\Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('gpspicker', '$_gpspicker = $_form[%node.word]; $_gpspickerControl = $_gpspicker->getControl(TRUE); echo $_gpspickerControl->addAttributes(%node.array)->startTag()', 'echo $_gpspickerControl->endTag(); unset($_gpspicker, $_gpspickerControl)');
$me->addMacro('gpspicker:input', array($me, 'macroInput'));
$me->addMacro('gpspicker:label', array($me, 'macroLabel'), '?></label><?php');
}
示例2: install
/**
* Register template macro into the latte compiler
*
* @param Compiler $compiler
* @return TemplateMacroSet Provides fluent interface
*/
public static function install(Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('template', array($me, 'macroTemplate'));
$me->addMacro('_', array($me, 'macroTranslate'), array($me, 'macroTranslate'));
return $me;
}
示例3: install
public static function install(Compiler $compiler)
{
$me = new static($compiler);
IfAllowedHrefMacro::install($compiler);
$me->addMacro('ifAllowedLink', array(get_called_class(), 'macroIfAllowedLink'), array(get_called_class(), 'macroIfAllowedLinkEnd'));
$me->addMacro('ifAllowed', array(get_called_class(), 'macroIfAllowed'), array(get_called_class(), 'macroIfAllowedEnd'));
}
示例4: install
public static function install(Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('input', [$me, 'macroInput']);
$me->addMacro('label', [$me, 'macroLabel'], [$me, 'macroLabelEnd']);
return $me;
}
示例5: install
/**
* @param \Latte\Compiler $compiler
* @return UIMacros
*/
public static function install(\Latte\Compiler $compiler)
{
$set = new static($compiler);
$set->addMacro('css', [$set, 'macroCss']);
$set->addMacro('js', [$set, 'macroJs']);
return $set;
}
示例6: install
public static function install(Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('snippetId', 'echo %escape($_control->getSnippetId(%node.word))');
$me->addMacro('param', 'echo %escape($_control->getParameterId(%node.word))');
$me->addMacro('dynamic', null, null, 'echo Nette\\Utils\\Html::el()->setClass("nittro-snippet-container")->data("dynamic-mask", $_control->getSnippetId(%node.word))->attributes()');
}
示例7: install
public static function install(Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('ifEnabled', array($me, 'macroIfEnabled'), array($me, 'macroEndIfEnabled'));
$me->addMacro('ifNotEnabled', array($me, 'macroIfNotEnabled'), array($me, 'macroEndIfEnabled'));
return $me;
}
示例8: install
public static function install(\Latte\Compiler $compiler)
{
$set = new static($compiler);
$set->addMacro('row', [$set, 'macroRow'], [$set, 'macroRowEnd']);
$set->addMacro('col', [$set, 'macroCol'], [$set, 'macroCoLEnd']);
$set->addMacro('rowCol', [$set, 'macroRowCol'], [$set, 'macroRowCoLEnd']);
}
示例9: install
public static function install(Latte\Parser $parser)
{
$me = new static($parser);
$me->addMacro('form', '$form = $control[%node.word]; echo $form->getElementPrototype()->addAttributes(%node.array)->startTag()', 'echo $form->getElementPrototype()->endTag()');
$me->addMacro('label', array($me, 'macroLabel'), '?></label><?php');
$me->addMacro('input', 'echo $form[%node.word]->getControl()->addAttributes(%node.array)');
}
示例10: install
public static function install(Latte\Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('input', array($me, 'macroInput'));
$me->addMacro('label', array($me, 'macroLabel'), array($me, 'macroLabelEnd'));
return $me;
}
示例11: install
public static function install(Latte\Compiler $parser)
{
$me = new static($parser);
$me->addMacro('inputlist', array($me, 'macroStartList'), array($me, 'macroEndList'));
$me->addMacro('input', array($me, 'macroInput'));
$me->addMacro('label', array($me, 'macroLabel'), '?></label><?php');
}
示例12: install
/**
* @param \Latte\Compiler $compiler
*/
public static function install(\Latte\Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('linkThumbnail', 'echo $_presenter->getContext()->getByType("Arachne\\Resources\\Thumbnailer")->getLinkThumbnail(%node.array)');
$me->addMacro('thumbnail', 'echo $_presenter->getContext()->getByType("Arachne\\Resources\\Thumbnailer")->getThumbnail(%node.array)');
$me->addMacro('thumbnailUrl', 'echo $_presenter->getContext()->getByType("Arachne\\Resources\\Thumbnailer")->getThumbnailUrl(%node.array)');
}
示例13: install
/**
* @param \Nette\Latte\Compiler $compiler
* @return \Nette\Latte\Macros\MacroSet|void
*/
public static function install(Latte\Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('scripts', array($me, 'macroScripts'));
$me->addMacro('styles', array($me, 'macroStyles'));
$me->addMacro('script', array($me, 'macroScript'));
$me->addMacro('style', array($me, 'macroStyle'));
}
示例14: install
public static function install(Latte\Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('loop', array($me, 'macroLoop'), array($me, 'macroLoopEnd'));
$me->addMacro('each', '', array($me, 'macroEachEnd'));
$me->addMacro('repeat', array($me, 'macroRepeat'), array($me, 'macroRepeatEnd'));
$me->addMacro('set', array($me, 'macroSet'));
}
示例15: install
public static function install(Compiler $compiler)
{
$me = new static($compiler);
$me->addMacro('head', array($me, 'headBegin'), array($me, 'headEnd'));
$me->addMacro('body', array($me, 'bodyBegin'), array($me, 'bodyEnd'));
$me->addMacro('content', array($me, 'contentBegin'));
$me->addMacro('extensions', array($me, 'extensionsBegin'));
}