/** * 未找到控制器的时候设置勾子 * */ public static function montFor404Page() { Plugin::mount('alpha.before_show_404_page', array(function () { $cmdLists = Config::get('framework_system_command'); $cmd = strtolower(trim(Route::$urlParams['path'], DIRECTORY_SEPARATOR)); if (isset($cmdLists[$cmd])) { call_user_func($cmdLists[$cmd]); } })); Plugin::hook('alpha.before_show_404_page'); }
/** * 挂载插件钩子 * */ public function __destruct() { Plugin::hook('alpha.run_controller_end'); }