Last active
August 29, 2015 14:01
-
-
Save jsifalda/8e781e6fc3a04038f44a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MacroInstaller extends Latte\Macros\MacroSet | |
{ | |
const OUTPUT = 'do-everything-with-that'; | |
/** | |
* @param Compiler $compiler | |
* @return void|static | |
*/ | |
public static function install(Latte\Compiler $compiler) | |
{ | |
$me = new static($compiler); | |
$me->addMacro('macroName', "echo '" . self::OUTPUT . "'"); | |
} | |
} | |
class MacroExtension extends Nette\DI\CompilerExtension implements Flame\Modules\Providers\ILatteMacrosProvider | |
{ | |
/** | |
* Get array of latte macros classes | |
* | |
* @return array | |
*/ | |
public function getLatteMacros() | |
{ | |
return array( | |
'MacroInstaller' | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment