No details. No define (BASE_PATH, dirname (_ FILE __). DIRECTORY_SEPARATOR); system root directory define (MODULE_PATH, BASE_PATH.modules.DIRECTORY_SEPARATOR); Module Directory $ moduleempty ($ _ GET [m])? : Strtolower ($ _ GET [m]); folder $ controlemp
No details. No define ('base _ path', dirname (_ FILE __). DIRECTORY_SEPARATOR); // system root directory define ('module _ path', BASE_PATH. 'modules '. DIRECTORY_SEPARATOR); // module Directory $ module = empty ($ _ GET ['M'])? '': Strtolower ($ _ GET ['M']); // folder $ control = emp
<无详细内容> <无>
Define ('base _ path', dirname (_ FILE __). DIRECTORY_SEPARATOR); // system root directory define ('module _ path', BASE_PATH. 'modules '. DIRECTORY_SEPARATOR); // module Directory $ module = empty ($ _ GET ['M'])? '': Strtolower ($ _ GET ['M']); // folder $ control = empty ($ _ GET ['C'])? 'Index': strtolower ($ _ GET ['C']); // file {class} $ action = empty ($ _ GET ['a'])? 'Index': strtolower ($ _ GET ['a']); // method if ($ module) {$ controlFile = MODULE_PATH. $ module. DIRECTORY_SEPARATOR. $ control. '. php'; if (! File_exists ($ controlFile) echo $ module. DIRECTORY_SEPARATOR. $ control. '. php '. 'class file does not exist'; exit (); include ($ controlFile); $ c = new $ control; if (! Method_exists ($ c, $ action) echo $ c. 'method does not exist'; exit (); $ c-> $ action ();} else {// default homepage [loading view with smarty template engine] $ smarty-> display('index.html ');}/** write a simple routing control function based on the parameter m, c, a, the module, file, and method that controls the response url. (MVC) URL. Description: MVC mode, m module [corresponding module folder], c controller [corresponding class file], method a [corresponding object method] If no module is specified, index [file | class] is accessed by default when no control is specified on the homepage of the system by default. if the file does not exist, the output file [Class] does not exist. If the action is not specified, the index [Method] is accessed by default. If the method does not exist, the output method does not exist. For example: http://www.xxx.com/web/index.php?m=admin Access the index method of the index file under the admin folder under module (the class name is the same as the file name */