/**
* Controller Scheduling
*
*/
private static function control () {
Level two domain name
if ($GLOBALS [' setting_config '] [' enabled_subdomain '] = = ' 1 ' && $_get[' act '] = = ' index ' && $_get[' op '] = = ' Index ') {
$store _id = subdomain ();
if ($store _id > 0) $_get[' act '] = ' show_store ';
}
$act _file = Realpath (base_path. ') /control/'. $_get[' act '. '. php ');
$class _name = $_get[' act ']. ' Control ';
if (! @include ($act _file)) {
if (C (' Debug ')) {
Throw_exception ("Base error:access file isn ' t exists!");
} else {
ShowMessage (' Sorry! The page you visited does not exist ', ' ', ' HTML ', ' Error ');
}
}
if (class_exists ($class _name)) {
$main = new $class _name ();
$function = $_get[' op ']. ' Op ';
if (Method_exists ($main, $function)) {
$main $function ();
}elseif (method_exists ($main, ' indexop ')) {
$main->indexop ();
}else {
$error = "Base error:function $function not in $class _name!";
Throw_exception ($error);
}
}else {
$error = "Base error:class $class _name isn ' t exists!";
Throw_exception ($error);
}
}
Reply to discussion (solution)
Put the get inside the $act and $op next, then act is the controller's name, the act is then assembled into $actcontrol, and then introduced the file, the introduction of the file failed to throw an exception, find the file to determine whether there is $opop this method, If there is no call to the Indexop method, if there is no exception to the throw method
The code snippet can be used in code format AH = = look at the headache.