I'm writing a form-helper class in php, that should check if a value is submitted via the method, the form defined.
public function getValue($name) {
$getFrom = ($this->method == 'post') ? '_POST' : '_GET';
return isset($$getFrom[$name]) ? $$getFrom[$name] : null;
}
$this->method is post or get, it's form-dependent. This method looks fine for me, but php throws a "Illegal string offset" warning. What can I do without using an if-block.
Thank you!