src/Form.php
private function redirectPost()
    {
        if (!isset($_SERVER['REQUEST_URI'])) {
            return;
        }
        if (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] != 'POST') {
            return;
        }
        if (!$this->cfg['prg']) {
            return;
        }
        if (!$this->status['submitted']) {
            return;
        }
        $this->debug->log('redirecting');
        $event = $this->eventManager->publish('page.redirect', null, array('location' => $_SERVER['REQUEST_URI']));
        $location = $event['location'];
        $this->debug->log('%cLocation:%c <a href="%s">%s</a>', 'font-weight:bold;', '', $location, $location);
        if (\headers_sent($file, $line)) {
            $this->debug->warn('headers alrady sent from '.$file.' line '.$line);
            return;
        }
        if ($event->isPropagationStopped()) {
            $this->debug->alert('<i class="fa fa-external-link fa-lg" aria-hidden="true"></i> Location: <a class="alert-link" href="'.\htmlspecialchars($location).'">'.\htmlspecialchars($location).'</a>', 'info');
        } else {
            \header('Location: '.$location);
        }
        throw new \Exception('exit');
    }
private function redirectPost()
    {
        if (!isset($_SERVER['REQUEST_URI'])) {
            return;
        }
        if (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] != 'POST') {
            return;
        }
        if (!$this->cfg['prg']) {
            return;
        }
        if (!$this->status['submitted']) {
            return;
        }
        $this->debug->log('redirecting');
        $event = $this->eventManager->publish('page.redirect', null, array('location' => $_SERVER['REQUEST_URI']));
        $location = $event['location'];
        $this->debug->log('%cLocation:%c <a href="%s">%s</a>', 'font-weight:bold;', '', $location, $location);
        if (\headers_sent($file, $line)) {
            $this->debug->warn('headers alrady sent from '.$file.' line '.$line);
            return;
        }
        if ($event->isPropagationStopped()) {
            $this->debug->alert('<i class="fa fa-external-link fa-lg" aria-hidden="true"></i> Location: <a class="alert-link" href="'.\htmlspecialchars($location).'">'.\htmlspecialchars($location).'</a>', 'info');
        } else {
            \header('Location: '.$location);
        }
        throw new \Exception('exit');
    }
private function redirectPost ( ) { if ( ! isset ( $ _SERVER [ 'REQUEST_URI' ] ) ) { return ; } if ( ! isset ( $ _SERVER [ 'REQUEST_METHOD' ] ) || $ _SERVER [ 'REQUEST_METHOD' ] != 'POST' ) { return ; } if ( ! $ this -> cfg [ 'prg' ] ) { return ; } if ( ! $ this -> status [ 'submitted' ] ) { return ; } $ this -> debug -> log ( 'redirecting' ) ; $ event = $ this -> eventManager -> publish ( 'page.redirect' , null , array ( 'location' => $ _SERVER [ 'REQUEST_URI' ] ) ) ; $ location = $ event [ 'location' ] ; $ this -> debug -> log ( '%cLocation:%c <a href="%s">%s</a>' , 'font-weight:bold;' , '' , $ location , $ location ) ; if ( \ headers_sent ( $ file , $ line ) ) { $ this -> debug -> warn ( 'headers alrady sent from ' . $ file . ' line ' . $ line ) ; return ; } if ( $ event -> isPropagationStopped ( ) ) { $ this -> debug -> alert ( '<i class="fa fa-external-link fa-lg" aria-hidden="true"></i> Location: <a class="alert-link" href="' . \ htmlspecialchars ( $ location ) . '">' . \ htmlspecialchars ( $ location ) . '</a>' , 'info' ) ; } else { \ header ( 'Location: ' . $ location ) ; } throw new \ Exception ( 'exit' ) ; }
Stores submitted values in persistence
Redirects if submoitted via POST

@return void
@throws \Exception Rather than exit.
Stores submitted values in persistence Redirects if submoitted via POST