Elgg  Version 3.0
Input.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Http;
4 
5 use Elgg\Context;
6 
17 class Input {
18 
22  protected $request;
23 
29  public function __construct(Request $request) {
30  $this->request = $request;
31  }
32 
43  public function set($key, $value) {
44  $this->request->request->set($key, $value);
45  }
46 
64  public function get($key, $default = null, $filter_result = true) {
65  $result = $default;
66 
67  $this->request->getContextStack()->push('input');
68 
70  $value = $request->get($key);
71  if ($value !== null) {
72  $result = $value;
73  if ($filter_result) {
75  }
76  }
77 
78  $this->request->getContextStack()->pop();
79 
80  return $result;
81  }
82 
90  public function all($filter_result = true) {
91  $query = $this->request->query->all();
92  $attributes = $this->request->attributes->all();
93  $post = $this->request->request->all();
94 
95  $result = array_merge($query, $attributes, $post);
96 
97  if ($filter_result) {
99  }
100 
101  return $result;
102  }
103 }
$query
Definition: groups.php:8
Elgg HTTP request.
Definition: Request.php:17
filter_tags($var)
Filter tags from a given string based on registered hooks.
Definition: input.php:82
all($filter_result=true)
Returns all values parsed from the request.
Definition: Input.php:90
$default
Definition: checkbox.php:35
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
Definition: summary.php:55
__construct(Request $request)
Constructor.
Definition: Input.php:29
$value
Definition: debugging.php:7
$attributes
Definition: ajax_loader.php:13