src/Form.php
public function setCurrentFields($i = null)
    {
        $this->debug->groupCollapsed(__METHOD__, $i);
        $this->debug->groupUncollapse();
        $cfg        = &$this->cfg;
        $status     = &$this->status;
        if (isset($i)) {
            $this->status['submitted'] = false;
            $this->persist->set('i', $i);
        }
        $this->resetStatus();
        // $this->debug->warn('currentPageName', $status['currentPageName']);
        // $this->debug->log('persist', $this->persist);
        // $this->debug->info('status', $status);
        // $this->debug->log('cfg', $cfg);
        $this->currentFields = isset($cfg['pages'][ $status['currentPageName'] ])
            ? $cfg['pages'][ $status['currentPageName'] ]
            : array();
        $this->debug->log('count(currentFields)', \count($this->currentFields));
        $this->currentValues = $this->persist->get('currentPage.values');
        // $this->debug->warn('currentValues', $this->currentValues);
        if (!empty($cfg['pre']) && \is_callable($cfg['pre'])) {
            $return = \call_user_func($cfg['pre'], $this);
            if ($return === false) {
                $status['error'] = 'pre error';
            }
        }
        $this->buildFields();
        $this->debug->groupEnd();
        return;
    }
public function setCurrentFields($i = null)
    {
        $this->debug->groupCollapsed(__METHOD__, $i);
        $this->debug->groupUncollapse();
        $cfg        = &$this->cfg;
        $status     = &$this->status;
        if (isset($i)) {
            $this->status['submitted'] = false;
            $this->persist->set('i', $i);
        }
        $this->resetStatus();
        // $this->debug->warn('currentPageName', $status['currentPageName']);
        // $this->debug->log('persist', $this->persist);
        // $this->debug->info('status', $status);
        // $this->debug->log('cfg', $cfg);
        $this->currentFields = isset($cfg['pages'][ $status['currentPageName'] ])
            ? $cfg['pages'][ $status['currentPageName'] ]
            : array();
        $this->debug->log('count(currentFields)', \count($this->currentFields));
        $this->currentValues = $this->persist->get('currentPage.values');
        // $this->debug->warn('currentValues', $this->currentValues);
        if (!empty($cfg['pre']) && \is_callable($cfg['pre'])) {
            $return = \call_user_func($cfg['pre'], $this);
            if ($return === false) {
                $status['error'] = 'pre error';
            }
        }
        $this->buildFields();
        $this->debug->groupEnd();
        return;
    }
public function setCurrentFields ( $ i = null ) { $ this -> debug -> groupCollapsed ( __METHOD__ , $ i ) ; $ this -> debug -> groupUncollapse ( ) ; $ cfg = & $ this -> cfg ; $ status = & $ this -> status ; if ( isset ( $ i ) ) { $ this -> status [ 'submitted' ] = false ; $ this -> persist -> set ( 'i' , $ i ) ; } $ this -> resetStatus ( ) ; // $this->debug->warn('currentPageName', $status['currentPageName']); // $this->debug->log('persist', $this->persist); // $this->debug->info('status', $status); // $this->debug->log('cfg', $cfg); $ this -> currentFields = isset ( $ cfg [ 'pages' ] [ $ status [ 'currentPageName' ] ] ) ? $ cfg [ 'pages' ] [ $ status [ 'currentPageName' ] ] : array ( ) ; $ this -> debug -> log ( 'count(currentFields)' , \ count ( $ this -> currentFields ) ) ; $ this -> currentValues = $ this -> persist -> get ( 'currentPage.values' ) ; // $this->debug->warn('currentValues', $this->currentValues); if ( ! empty ( $ cfg [ 'pre' ] ) && \ is_callable ( $ cfg [ 'pre' ] ) ) { $ return = \ call_user_func ( $ cfg [ 'pre' ] , $ this ) ; if ( $ return === false ) { $ status [ 'error' ] = 'pre error' ; } } $ this -> buildFields ( ) ; $ this -> debug -> groupEnd ( ) ; return ; }
Set current "page"

@param integer $i index of forms/fields to use

@return void
Set current page