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

        $get    = Get::getInstance();
        $params = $this->route->getParameterCollection();

        $account = null;
        $date    = new \DateTimeImmutable(date('Y-m-01'));

        if ($params->hasByName('id')) {

            $account = $this->verifyAccount((int) $params->getByName('id')->getValue());

            if ($get->has('date_start')) {
                $date = new \DateTimeImmutable($get->get('date_start'));
                $date = $date->setDate($date->format('Y'), $date->format('m'), 1);
            }

            $this->checkMonth($account->getId(), $date);
        }

        //~ Content
        $this->dataCollection->add('title',   'Budgets');
        $this->dataCollection->add('date',    $date);
        $this->dataCollection->add('account', $account);

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

        $get    = Get::getInstance();
        $params = $this->route->getParameterCollection();

        $account = null;
        $date    = new \DateTimeImmutable(date('Y-m-01'));

        if ($params->hasByName('id')) {

            $account = $this->verifyAccount((int) $params->getByName('id')->getValue());

            if ($get->has('date_start')) {
                $date = new \DateTimeImmutable($get->get('date_start'));
                $date = $date->setDate($date->format('Y'), $date->format('m'), 1);
            }

            $this->checkMonth($account->getId(), $date);
        }

        //~ Content
        $this->dataCollection->add('title',   'Budgets');
        $this->dataCollection->add('date',    $date);
        $this->dataCollection->add('account', $account);

        return $this->getResponse('Budgets');
    }
public function index ( ) { //~ Breadcrumb $ this -> breadcrumb -> add ( ( new BreadcrumbItem ( 'List' ) ) -> setIcon ( 'list' ) -> setIsActive ( true ) ) ; $ get = Get :: getInstance ( ) ; $ params = $ this -> route -> getParameterCollection ( ) ; $ account = null ; $ date = new \ DateTimeImmutable ( date ( 'Y-m-01' ) ) ; if ( $ params -> hasByName ( 'id' ) ) { $ account = $ this -> verifyAccount ( ( int ) $ params -> getByName ( 'id' ) -> getValue ( ) ) ; if ( $ get -> has ( 'date_start' ) ) { $ date = new \ DateTimeImmutable ( $ get -> get ( 'date_start' ) ) ; $ date = $ date -> setDate ( $ date -> format ( 'Y' ) , $ date -> format ( 'm' ) , 1 ) ; } $ this -> checkMonth ( $ account -> getId ( ) , $ date ) ; } //~ Content $ this -> dataCollection -> add ( 'title' , 'Budgets' ) ; $ this -> dataCollection -> add ( 'date' , $ date ) ; $ this -> dataCollection -> add ( 'account' , $ account ) ; return $ this -> getResponse ( 'Budgets' ) ; }
Main controller action. OK

@return ResponseInterface
Main controller action . OK