Here's how this route is interpreted

Source: Internet
Author: User
/**
* 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.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.