/** * Suppress redirections and print any messages * stored in session flashdata * * @param string $location * @param boolean $method * @param int|null $statusCode * @return void */ public function redirect($location, $method = false, $statusCode = null) { $this->successMessage = null; $this->errorMessage = null; $location = str_replace('&', '&', $location); if (substr_count($location, '?') > 1) { $location = substr($location, strpos($location, '?') + 1); } parse_str(parse_url($location, PHP_URL_QUERY), $this->variables); $success = ee()->session->flashdata(':new:message_success'); $failure = ee()->session->flashdata(':new:message_failure'); if ($failure) { $this->app->addError($failure); $this->errorMessage = $failure; } if ($success) { $this->successMessage = $success; } }
/** * {@inheritdoc} */ public function show_user_error($type, $errors, $heading = '') { $this->resetMessages(); if (!is_array($errors)) { $errors = array($errors); } foreach ($errors as $error) { $this->app->addError($error); } $this->errorMessage = implode(PHP_EOL, $errors); }