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,7 +54,7 @@ class SeedDMS_Controller_Common {
* @return mixed return value of called method * @return mixed return value of called method
*/ */
function __invoke($get=array()) { function __invoke($get=array()) {
$this->callHook('preRun', 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(isset($get['action']) && $get['action']) {
if(method_exists($this, $get['action'])) { if(method_exists($this, $get['action'])) {
return $this->{$get['action']}(); return $this->{$get['action']}();
@ -64,7 +64,8 @@ class SeedDMS_Controller_Common {
} }
} else } else
return $this->run(); return $this->run();
$this->callHook('postRun', isset($get['action']) ? $get['action'] : 'run'); }
$this->callHook('postRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get);
} }
function setParams($params) { function setParams($params) {