yii2路由篇 --- Url类使用集锦
来源:互联网 发布:视频剪辑专用软件 编辑:程序博客网 时间:2024/05/23 15:03
### Url::to() 示例use yii\helpers\Url;// creates a URL to a route: /index.php?r=post%2Findexecho Url::to(['post/index']);// 带参数 url: /index.php?r=post%2Fview&id=100echo Url::to(['post/view', 'id' => 100]);// 元素 锚点 URL: /index.php?r=post%2Fview&id=100#contentecho Url::to(['post/view', 'id' => 100, '#' => 'content']);// 绝对 URL: http://www.example.com/index.php?r=post%2Findexecho Url::to(['post/index'], true);// https url: https://www.example.com/index.php?r=post%2Findexecho Url::to(['post/index'], 'https');// 相对url: /index.php?r=post%2Findexecho Url::to(['/post/index']);// 全局别名url: http://example.comYii::setAlias('@example', 'http://example.com/');echo Url::to('@example');// home page URL: /index.php?r=site%2Findexecho Url::home();// the base URL, useful if the application is deployed in a sub-folder of the Web rootecho Url::base();// the canonical URL of the currently requested URL// see https://en.wikipedia.org/wiki/Canonical_link_elementecho Url::canonical();// 记录跳转前地址Url::remember();echo Url::previous();
引用BKDUCK博客 http://www.bkduck.com/article/20
0 0
- yii2路由篇 --- Url类使用集锦
- Yii2.0美化路由Url
- YII2设置路由访问,美化url
- Yii2 - 02控制器、路由、Url生成
- [路由] -- Yii2 url地址美化与重写
- 从头开始学习yii2---2.url的路由配置
- ASP.NET MVC URL重写与优化(初级篇)-使用Global路由表定制URL
- ASP.NET MVC URL重写与优化(初级篇)-使用Global路由表定制URL
- ASP.NET MVC URL重写与优化(初级篇)-使用Global路由表定制URL
- Yii2 路由之同时支持 URL 原始和美化的请求 [ 2.0 版本 ]
- [路由] -- Yii2 url地址美化与重写[2.0版本]
- Yii2下路由设定
- yii2.0路由
- Yii2 路由美化
- Yii2.0 路由
- YII2路由(Route)
- yii2 自定义restful路由
- Yii2 路由美化
- 2270 Problem F拼接海报
- Intent 意图 用于Activity之间的数据传递
- HihoCoder 1079 线段树 + 离散化
- Implicit declaration of function 'inet_addr' is invalid in C99
- 4-4 将正整数n逆序输出。 (25分)
- yii2路由篇 --- Url类使用集锦
- Ubuntu 16.04安装MinGW32
- 访问虚拟机中的服务器
- 日历代码
- android studio 中terminal 颜色设置
- PHP 防SQL注入和XSS攻击
- 用 1 2 3 4 四个数字组成的互不相同且不重复的三位数。
- 从服务器返回的字符串,先转成byte[],然后保存到文件,listview根据uri获取显示
- KNN分类和估计分类器的精度