setFlashdata example

/** * Sets the current $_GET and $_POST arrays in the session. * This also saves the validation errors. * * It will then be available via the 'old()' helper function. * * @return $this */
    public function withInput()
    {
        $session = Services::session();
        $session->setFlashdata('_ci_old_input', [
            'get'  => $_GET ?? [],
            'post' => $_POST ?? [],
        ]);

        $this->withErrors();

        return $this;
    }

    /** * Sets validation errors in the session. * * If the validation has any errors, transmit those back * so they can be displayed when the validation is handled * within a method different than displaying the form. * * @return $this */
Home | Imprint | This part of the site doesn't use cookies.