ThinkPHP模板内使用U方法

原文地址:https://www.cnblogs.com/xiaoliwang/p/8001715.html

三种携带参数的方法:

U('Blog/cate',array('cate_id'=>1,'status'=>1))

U('Blog/cate','cate_id=1&status=1')

U('Blog/cate?cate_id=1&status=1')

在控制器中可以直接使用 U(‘Home/Index/index’)

在模板内使用方法:{:U(‘Home/Index/index')}

在超链接中使用时如需携带参数使用数组形式 : {:U('Index/test',array('name'=>$item['name']))}

猜你喜欢

转载自blog.csdn.net/weixin_42545184/article/details/84659600
今日推荐