Elgg  Version 4.x
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 }
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
setParams(array $params=[])
Set params to provide context about the exception.
getParam($name)
Get a parameter value.
setRedirectUrl($url)
Set preferred redirect URL If set, a redirect response will be issued.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:686
Generic HTTP exception.
getParams()
Retrieve exception parameters.
getRedirectUrl()
Get preferred redirect URL.