59 public function all() {
69 return array_keys($this->parameters);
90 $this->parameters = array_merge($this->parameters,
$parameters);
105 if (!$deep ||
false === $pos = strpos(
$path,
'[')) {
106 return array_key_exists(
$path, $this->parameters) ? $this->parameters[
$path] :
$default;
109 $root = substr(
$path, 0, $pos);
110 if (!array_key_exists($root, $this->parameters)) {
114 $value = $this->parameters[$root];
116 for ($i = $pos,
$c = strlen(
$path); $i <
$c; $i++) {
120 if (null !== $currentKey) {
121 throw new \InvalidArgumentException(sprintf(
'Malformed path. Unexpected "[" at position %d.', $i));
125 } elseif (
']' === $char) {
126 if (null === $currentKey) {
127 throw new \InvalidArgumentException(sprintf(
'Malformed path. Unexpected "]" at position %d.', $i));
130 if (!is_array(
$value) || !array_key_exists($currentKey,
$value)) {
137 if (null === $currentKey) {
138 throw new \InvalidArgumentException(sprintf(
'Malformed path. Unexpected "%s" at position %d.', $char, $i));
141 $currentKey .= $char;
145 if (null !== $currentKey) {
146 throw new \InvalidArgumentException(sprintf(
'Malformed path. Path must end with "]".'));
171 return array_key_exists(
$key, $this->parameters);
181 unset($this->parameters[
$key]);
194 return preg_replace(
'/[^[:alpha:]]/',
'', $this->
get(
$key, $default, $deep));
207 return preg_replace(
'/[^[:alnum:]]/',
'', $this->
get(
$key, $default, $deep));
221 return str_replace(array(
'-',
'+'),
'', $this->
filter(
$key, $default, $deep, FILTER_SANITIZE_NUMBER_INT));
260 $options[
'flags'] = FILTER_REQUIRE_ARRAY;
272 return new \ArrayIterator($this->parameters);
281 return count($this->parameters);
__construct(array $parameters=array())
Constructor.
getIterator()
Returns an iterator for parameters.
replace(array $parameters=array())
Replaces the current parameters by a new set.
getDigits($key, $default= '', $deep=false)
Returns the digits of the parameter value.
keys()
Returns the parameter keys.
filter($key, $default=null, $deep=false, $filter=FILTER_DEFAULT, $options=array())
Filter key.
has($key)
Returns true if the parameter is defined.
getAlpha($key, $default= '', $deep=false)
Returns the alphabetic characters of the parameter value.
if(!$vars['title']&&$vars['title']!==false) if(isset($vars['filter_override'])) if(!isset($vars['filter'])&&elgg_is_logged_in()&&$context) $filter
add(array $parameters=array())
Adds parameters.
getAlnum($key, $default= '', $deep=false)
Returns the alphabetic characters and digits of the parameter value.
all()
Returns the parameters.
count()
Returns the number of parameters.
getInt($key, $default=0, $deep=false)
Returns the parameter value converted to integer.