mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Show piggy banks [skip ci]
This commit is contained in:
@@ -9,11 +9,11 @@ use Twig_SimpleFilter;
|
||||
use Twig_SimpleFunction;
|
||||
|
||||
/**
|
||||
* Class Journals
|
||||
* Class Journal
|
||||
*
|
||||
* @package FireflyIII\Support\Twig
|
||||
*/
|
||||
class Journals extends Twig_Extension
|
||||
class Journal extends Twig_Extension
|
||||
{
|
||||
|
||||
public function getFilters()
|
41
app/Support/Twig/PiggyBank.php
Normal file
41
app/Support/Twig/PiggyBank.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace FireflyIII\Support\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use FireflyIII\Models\PiggyBank as PB;
|
||||
|
||||
/**
|
||||
* Class PiggyBank
|
||||
*
|
||||
* @package FireflyIII\Support\Twig
|
||||
*/
|
||||
class PiggyBank extends Twig_Extension
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
$functions = [];
|
||||
|
||||
$functions[] = new Twig_SimpleFunction(
|
||||
'currentRelevantRepAmount', function (PB $piggyBank) {
|
||||
return $piggyBank->currentRelevantRep()->currentamount;
|
||||
}
|
||||
);
|
||||
return $functions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the extension.
|
||||
*
|
||||
* @return string The extension name
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'FireflyIII\Support\Twig\PiggyBank';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user