企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## :-: 手机端路由 $this->url() - 模块中二次封装了微擎系统的 createMobileUrl和createWebUrl 函数,使用时变的更加简单 ### 说明 ~~~ $this->url(string $string); ~~~ 生成手机端url | 用法 | 描述 | | --- | --- | | 不带任何参数 | 当前路由 | | \[模块/\]\[控制器/\]\[操作\] | 常用写法,支持跨模块 | ### 示例: 控制器位于`/inc/mobile/Index.php`中,请看以下实例: ~~~ // +---------------------------------------------------------------------- // | onegow [ WE CAN DO IT MORE SIMPLE] // +---------------------------------------------------------------------- // | Copyright (c) 2016-2018 http://onegow.com All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: mrye 55585190@qq.com // +---------------------------------------------------------------------- namespace inc\mobile; class Index extends Base { /** * 访问路径:http://wq.mrye.xin/app/index.php?i=2&c=entry&do=index-home&m=og_test * 下面route()生成的链接会进入到这里 */ public function home() { echo 'this is home controller'; } /** * 跨方法路由 * 访问路径:http://wq.mrye.xin/app/index.php?i=2&c=entry&do=index-route&m=og_test */ public function route() { //此路径会跳转至 Index控制器底下的 home 方法 echo $this->url('home'); } /** * 跨控制器路由 * 访问路径:http://wq.mrye.xin/app/index.php?i=2&c=entry&do=index-route2&m=og_test */ public function route2() { //此路径会跳转至 Action控制器底下的 index 方法 echo $this->url('action/index'); } /** * 跨模块路由 * 访问路径:http://wq.mrye.xin/app/index.php?i=2&c=entry&do=index-route3&m=og_test */ public function route3() { //此路径会跳转至 web模块index控制器底下的 admin 方法 echo $this->url('web/index/admin'); } } ~~~