Lines Matching defs:default
9 * All function access the $_REQUEST array by default, if you want to access $_POST or $_GET
111 * @param mixed $default Default to return if parameter isn't set
112 * @param bool $nonempty Return $default if parameter is set but empty()
115 public function param($name, $default = null, $nonempty = false)
117 if (!isset($this->access[$name])) return $default;
119 if ($nonempty && empty($value)) return $default;
138 * and intialized with the given $default value before a reference is returned
141 * @param mixed $default If parameter is not set, initialize with this value
142 * @param bool $nonempty Init with $default if parameter is set but empty()
145 public function &ref($name, $default = '', $nonempty = false)
148 $this->set($name, $default);
158 * @param int $default Default to return if parameter isn't set or is an array
159 * @param bool $nonempty Return $default if parameter is set but empty()
162 public function int($name, $default = 0, $nonempty = false)
164 if (!isset($this->access[$name])) return $default;
165 if (is_array($this->access[$name])) return $default;
167 if ($value === '') return $default;
168 if ($nonempty && empty($value)) return $default;
177 * @param string $default Default to return if parameter isn't set or is an array
178 * @param bool $nonempty Return $default if parameter is set but empty()
181 public function str($name, $default = '', $nonempty = false)
183 if (!isset($this->access[$name])) return $default;
184 if (is_array($this->access[$name])) return $default;
186 if ($nonempty && empty($value)) return $default;
200 * @param mixed $default Default to return if parameter isn't set or not valid
203 public function valid($name, $valids, $default = null)
205 if (!isset($this->access[$name])) return $default;
206 if (is_array($this->access[$name])) return $default; // we don't allow arrays
210 return $default;
219 * @param mixed $default Default to return if parameter isn't set
220 * @param bool $nonempty Return $default if parameter is set but empty()
223 public function bool($name, $default = false, $nonempty = false)
225 if (!isset($this->access[$name])) return $default;
226 if (is_array($this->access[$name])) return $default;
228 if ($value === '') return $default;
229 if ($nonempty && empty($value)) return $default;
238 * @param mixed $default Default to return if parameter isn't set
239 * @param bool $nonempty Return $default if parameter is set but empty()
242 public function arr($name, $default = [], $nonempty = false)
244 if (!isset($this->access[$name])) return $default;
245 if (!is_array($this->access[$name])) return $default;
246 if ($nonempty && empty($this->access[$name])) return $default;