More extensions and views. First home view is semi-complete, time to write some tests again.

This commit is contained in:
James Cole
2014-07-06 21:07:52 +02:00
parent 4192f2bc8f
commit 2f5afc80a3
14 changed files with 206 additions and 51 deletions

View File

@@ -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);