/** * 控制器调度 * */ private static function control(){ //二级域名 //var_dump($GLOBALS['setting_config']['enabled_subdomain']); 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'; //echo $act_file; if (!@include($act_file)){ if (C('debug')) { throw_exception("Base Error: access file isn't exists!"); } else { showMessage('抱歉!您访问的页面不存在','','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); } }
bee餐饮点餐外卖小程序是针对餐饮行业推出的一套完整的餐饮解决方案,实现了用户在线点餐下单、外卖、叫号排队、支付、配送等功能,完美的使餐饮行业更高效便捷!功能演示:1、桌号管理登录后台,左侧菜单 “桌号管理”,添加并管理你的桌号信息,添加以后在列表你将可以看到 ID 和 密钥,这两个数据用来生成桌子的二维码2、生成桌子二维码例如上面的ID为 308,密钥为 d3PiIY,那么现在去左侧菜单微信设置
1
根据controler与action,判断要调用的类与方法
$act_file = realpath(BASE_PATH.'/control/'.$_GET['act'].'.php');$class_name = $_GET['act'].'Control';
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); } }
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号