src/Money/Module/Category/Controller/Category.php
public function index()
    {
        //~ Breadcrumb
        $this->breadcrumb->add((new BreadcrumbItem('List'))->setIcon('list')->setIsActive(true));
        $this->navMenu->getItem('List')->setIsActive(true);

        //~ Content
        $this->dataCollection->add('title', 'List of categories');

        $bankMapper = new BankMapper(Database::get('money'));
        $banks      = $bankMapper->select();

        $accountUserMapper = new AccountUserMapper(Database::get('money'));
        $userAccounts      = $accountUserMapper->findByUserId((int) Session::getInstance()->get('id'));

        $accounts = array();
        foreach ($userAccounts as $userAccount) {
            $account = $userAccount->getAccount();

            if (!isset($accounts[$account->getBankId()])) {
                $accounts[$account->getBankId()] = array();
            }

            $accounts[$account->getBankId()][] = $account;
        }

        $this->dataCollection->add('banks', $banks);
        $this->dataCollection->add('accounts', $accounts);

        return $this->getResponse('List');
    }
public function index()
    {
        //~ Breadcrumb
        $this->breadcrumb->add((new BreadcrumbItem('List'))->setIcon('list')->setIsActive(true));
        $this->navMenu->getItem('List')->setIsActive(true);

        //~ Content
        $this->dataCollection->add('title', 'List of categories');

        $bankMapper = new BankMapper(Database::get('money'));
        $banks      = $bankMapper->select();

        $accountUserMapper = new AccountUserMapper(Database::get('money'));
        $userAccounts      = $accountUserMapper->findByUserId((int) Session::getInstance()->get('id'));

        $accounts = array();
        foreach ($userAccounts as $userAccount) {
            $account = $userAccount->getAccount();

            if (!isset($accounts[$account->getBankId()])) {
                $accounts[$account->getBankId()] = array();
            }

            $accounts[$account->getBankId()][] = $account;
        }

        $this->dataCollection->add('banks', $banks);
        $this->dataCollection->add('accounts', $accounts);

        return $this->getResponse('List');
    }
Main controller action.

@return ResponseInterface