在入口页开启路由配置 <?php define('PG_ROUTE', true);//在框架核心文件引用前定义 include 'phpGrace/phpGrace.php'; 在分组目录内找到 router.php 编写路由规则 如: return array( 'about' => array('index', 'about', array(120, 'grace')), 'other' => array('index', 'other') ); 路由: 'about' => array('index', 'about', array(120, 'grace')) 代表:/about 会访问 index 控制器内的 about 方法 并携带 参数 120和 grace (保存在 $this->gets) 。 路由: 'other' => array('index', 'other') 代表:/other 会访问 index 控制器内的 other 方法。 Loading... 在入口页开启路由配置 <?php define('PG_ROUTE', true);//在框架核心文件引用前定义 include 'phpGrace/phpGrace.php'; 在分组目录内找到 router.php 编写路由规则 如: return array( 'about' => array('index', 'about', array(120, 'grace')), 'other' => array('index', 'other') ); 路由: 'about' => array('index', 'about', array(120, 'grace')) 代表:/about 会访问 index 控制器内的 about 方法 并携带 参数 120和 grace (保存在 $this->gets) 。 路由: 'other' => array('index', 'other') 代表:/other 会访问 index 控制器内的 other 方法。 最后修改:2019 年 12 月 23 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 支持就是力量