public function handle($args = [])
{
if (!$this->enabled()) {
return false;
}
if (!is_array($args)) {
$args = (array) $args;
}
$method = '_' . strtolower($this->_request()->method());
if (method_exists($this, $method)) {
$this->_responding = true;
$this->_controller()->eventManager()->on($this);
return call_user_func_array([$this, $method], $args);
}
if (method_exists($this, '_handle')) {
$this->_responding = true;
$this->_controller()->eventManager()->on($this);
return call_user_func_array([$this, '_handle'], $args);
}
throw new NotImplementedException(sprintf('Action %s does not implement a handler for HTTP verb %s', get_class($this), $method));
}