Why params plugin magic function default forwarding route?
Why zf not able to get function from parameter like sample below?
public function __invoke($param = null,$type='Route', $default = null)
{
if ($param === null) {
return $this;
}
$type = 'from'.ucfirst($type);
// Need to check function exist, if not must throw some error
return $this->$type($param, $default);
}
Example use
$this->params('name','post');
$this->params('token','get');
$this->params('action'); // this will return from route like default one.
How can i extend default params plugin like this? And is it a good move?