Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @param array $errors : optional assign it to
- * @param string $target : url for redirect of the request
- */
- protected function forwardRequest(array $errors = null, $target = null) {
- //check for given target and try to fall back to previous page if needed
- if ($target == null) {
- if (!isset($_REQUEST[self::PAGE])) {
- throw new Exception('Missing target for forward.');
- }
- $target = $_REQUEST[self::PAGE];
- }
- //forward request to target
- // optional - add errors to redirect and process them in view
- if (count($errors) > 0)
- $target .= '&errors=' . urlencode(serialize($errors));
- header('location: ' . $target);
- exit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement