Last active
August 29, 2015 14:01
-
-
Save jsifalda/7f570f94974b62163117 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 HelperProvider implements Flame\Modules\Template\IHelperProvider | |
{ | |
/** | |
* Provide custom helper registration | |
* | |
* @param Engine $engine | |
* @return void | |
*/ | |
public function register(Latte\Engine $engine) | |
{ | |
$engine->addFilter('helperName', function ($node) { | |
echo 'do-everything-with-that' . $node; | |
}); | |
} | |
} | |
class HelperExtension extends Nette\DI\CompilerExtension implements Flame\Modules\Providers\ITemplateHelpersProvider | |
{ | |
/** | |
* Return list of helpers definitions or providers | |
* | |
* @return array | |
*/ | |
public function getHelpersConfiguration() | |
{ | |
return array( | |
'HelperProvider' | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment