Lines Matching defs:name
76 * @param string $name Parameter name
79 public function has($name)
81 return isset($this->access[$name]);
91 * @param string $name Parameter name
93 public function remove($name)
95 if (isset($this->access[$name])) {
96 unset($this->access[$name]);
99 if (isset($this->post) && isset($_POST[$name])) {
100 unset($_POST[$name]);
102 if (isset($this->get) && isset($_GET[$name])) {
103 unset($_GET[$name]);
110 * @param string $name Parameter name
115 public function param($name, $default = null, $nonempty = false)
117 if (!isset($this->access[$name])) return $default;
118 $value = $this->applyfilter($this->access[$name]);
126 * @param string $name Parameter name
129 public function set($name, $value)
131 $this->access[$name] = $value;
140 * @param string $name Parameter name
145 public function &ref($name, $default = '', $nonempty = false)
147 if (!isset($this->access[$name]) || ($nonempty && empty($this->access[$name]))) {
148 $this->set($name, $default);
151 return $this->access[$name];
157 * @param string $name Parameter name
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;
166 $value = $this->applyfilter($this->access[$name]);
176 * @param string $name Parameter name
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;
185 $value = $this->applyfilter($this->access[$name]);
198 * @param string $name Parameter name
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
207 $value = $this->applyfilter($this->access[$name]);
218 * @param string $name Parameter name
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;
227 $value = $this->applyfilter($this->access[$name]);
237 * @param string $name Parameter name
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;
248 return $this->access[$name];
255 * For example when the information was submitted as the name of a submit button.
263 * @param string $name
266 public function extract($name)
268 if (!isset($this->access[$name])) return $this;
269 if (!is_array($this->access[$name])) return $this;
270 $keys = array_keys($this->access[$name]);
273 $this->remove($name);
280 $value = array_shift($this->access[$name]);
283 $this->set($name, $value);