58 public function all() {
68 return array_keys($this->parameters);
89 $this->parameters = array_merge($this->parameters,
$parameters);
104 if (!$deep ||
false === $pos = strpos(
$path,
'[')) {
105 return array_key_exists(
$path, $this->parameters) ? $this->parameters[
$path] :
$default;
108 $root = substr(
$path, 0, $pos);
109 if (!array_key_exists($root, $this->parameters)) {
113 $value = $this->parameters[$root];
115 for ($i = $pos,
$c = strlen(
$path); $i <
$c; $i++) {
119 if (null !== $currentKey) {
120 throw new InvalidArgumentException(sprintf(
'Malformed path. Unexpected "[" at position %d.', $i));
124 } elseif (
']' === $char) {
125 if (null === $currentKey) {
126 throw new InvalidArgumentException(sprintf(
'Malformed path. Unexpected "]" at position %d.', $i));
129 if (!is_array(
$value) || !array_key_exists($currentKey,
$value)) {
136 if (null === $currentKey) {
137 throw new InvalidArgumentException(sprintf(
'Malformed path. Unexpected "%s" at position %d.', $char, $i));
140 $currentKey .= $char;
144 if (null !== $currentKey) {
145 throw new InvalidArgumentException(sprintf(
'Malformed path. Path must end with "]".'));
170 return array_key_exists(
$key, $this->parameters);
180 unset($this->parameters[
$key]);
193 return preg_replace(
'/[^[:alpha:]]/',
'', $this->
get(
$key, $default, $deep));
206 return preg_replace(
'/[^[:alnum:]]/',
'', $this->
get(
$key, $default, $deep));
220 return str_replace(array(
'-',
'+'),
'', $this->
filter(
$key, $default, $deep, FILTER_SANITIZE_NUMBER_INT));
259 $options[
'flags'] = FILTER_REQUIRE_ARRAY;
271 return new ArrayIterator($this->parameters);
280 return count($this->parameters);
count()
Returns the number of parameters.
all()
Returns the parameters.
__construct(array $parameters=array())
Constructor.
add(array $parameters=array())
Adds parameters.
keys()
Returns the parameter keys.
replace(array $parameters=array())
Replaces the current parameters by a new set.
filter($key, $default=null, $deep=false, $filter=FILTER_DEFAULT, $options=array())
Filter key.
if(!$vars['title']&&$vars['title']!==false) if(isset($vars['filter_override'])) if(!isset($vars['filter'])&&elgg_is_logged_in()&&$context) $filter
has($key)
Returns true if the parameter is defined.
getIterator()
Returns an iterator for parameters.
getAlnum($key, $default= '', $deep=false)
Returns the alphabetic characters and digits of the parameter value.
getAlpha($key, $default= '', $deep=false)
Returns the alphabetic characters of the parameter value.
getDigits($key, $default= '', $deep=false)
Returns the digits of the parameter value.
getInt($key, $default=0, $deep=false)
Returns the parameter value converted to integer.