/** * Execute action * */ public function exec() { Rock::setController($this); if (class_exists("RPlugin")) { RPlugin::callBefore(); } $this->onBefore(); $method = "do" . $this->_action; if (!method_exists($this, $method)) { trigger_error("can not find action '{$this->_action}' in class '" . get_class($this) . "'", E_USER_ERROR); } $ret = $this->{$method}(); if (is_object($ret) && $ret instanceof RView) { $ret->display(); } $this->onAfter(); if (class_exists("RPlugin")) { RPlugin::callAfter(); } }