firefly-iii/app/Support/Twig/PiggyBank.php

43 lines
767 B
PHP
Raw Normal View History

2015-05-02 04:32:45 -05:00
<?php
namespace FireflyIII\Support\Twig;
2015-05-03 05:58:55 -05:00
use FireflyIII\Models\PiggyBank as PB;
2015-05-02 04:32:45 -05:00
use Twig_Extension;
use Twig_SimpleFunction;
/**
* Class PiggyBank
*
* @package FireflyIII\Support\Twig
*/
class PiggyBank extends Twig_Extension
{
/**
*
*/
public function getFunctions()
{
$functions = [];
$functions[] = new Twig_SimpleFunction(
2015-06-06 16:09:12 -05:00
'currentRelevantRepAmount', function (PB $piggyBank) {
2015-05-02 04:32:45 -05:00
return $piggyBank->currentRelevantRep()->currentamount;
}
);
2015-05-03 05:58:55 -05:00
2015-05-02 04:32:45 -05:00
return $functions;
}
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
public function getName()
{
return 'FireflyIII\Support\Twig\PiggyBank';
}
}