pass array passed to __invoke() to hooks preRun and postRun

This commit is contained in:
Uwe Steinmann 2022-07-26 11:33:12 +02:00
parent 525eea082c
commit 6421aa94ed

View File

@ -54,17 +54,18 @@ class SeedDMS_Controller_Common {
* @return mixed return value of called method
*/
function __invoke($get=array()) {
$this->callHook('preRun', isset($get['action']) ? $get['action'] : 'run');
if(isset($get['action']) && $get['action']) {
if(method_exists($this, $get['action'])) {
return $this->{$get['action']}();
} else {
echo "Missing action '".$get['action']."'";
return false;
}
} else
return $this->run();
$this->callHook('postRun', isset($get['action']) ? $get['action'] : 'run');
if(!$this->callHook('preRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get)) {
if(isset($get['action']) && $get['action']) {
if(method_exists($this, $get['action'])) {
return $this->{$get['action']}();
} else {
echo "Missing action '".$get['action']."'";
return false;
}
} else
return $this->run();
}
$this->callHook('postRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get);
}
function setParams($params) {