Elgg  Version 6.1
HttpException.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Exceptions;
4 
10 class HttpException extends Exception {
11 
15  protected $params = [];
16 
20  protected $url;
21 
29  public function setParams(array $params = []) {
30  $this->params = $params;
31  }
32 
37  public function getParams() {
38  return $this->params;
39  }
40 
46  public function getParam($name) {
47  return elgg_extract($name, $this->params);
48  }
49 
57  public function setRedirectUrl($url) {
58  $this->url = $url;
59  }
60 
65  public function getRedirectUrl() {
66  return $this->url;
67  }
68 }
setParams(array $params=[])
Set params to provide context about the exception.
getParam($name)
Get a parameter value.
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
setRedirectUrl($url)
Set preferred redirect URL If set, a redirect response will be issued.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:256
Base exception of exceptions in the Elgg system.
Definition: Exception.php:11
Generic HTTP exception.
getParams()
Retrieve exception parameters.
getRedirectUrl()
Get preferred redirect URL.