mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-09 03:08:09 +00:00
More extensions and views. First home view is semi-complete, time to write some tests again.
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
<?php
|
||||
use Firefly\Helper\Preferences\PreferencesHelperInterface as PHI;
|
||||
use Firefly\Storage\Account\AccountRepositoryInterface as ARI;
|
||||
use Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface as TJRI;
|
||||
|
||||
|
||||
class HomeController extends BaseController
|
||||
{
|
||||
protected $accounts;
|
||||
protected $preferences;
|
||||
protected $tj;
|
||||
|
||||
public function __construct(ARI $accounts, PHI $preferences)
|
||||
public function __construct(ARI $accounts, PHI $preferences, TJRI $tj)
|
||||
{
|
||||
$this->accounts = $accounts;
|
||||
$this->preferences = $preferences;
|
||||
$this->tj = $tj;
|
||||
View::share('menu', 'home');
|
||||
}
|
||||
|
||||
@@ -28,6 +31,11 @@ class HomeController extends BaseController
|
||||
$list = $this->accounts->getByIds($pref->data);
|
||||
}
|
||||
|
||||
// get transactions for each account:
|
||||
foreach ($list as $account) {
|
||||
$account->transactionList = $this->tj->getByAccount($account,10);
|
||||
}
|
||||
|
||||
|
||||
// build the home screen:
|
||||
return View::make('index')->with('count', $count)->with('accounts', $list);
|
||||
|
||||
Reference in New Issue
Block a user