Yii框架下不同contoller之间的方法调用
一个contoller CustomerController里怎么调用另一个controller里的action,Acontoller调用SiteContoller的actionShow($id), url显示上是Customer/index
$control=Yii::app()->runController('site/show/id/2');
不带参数的actionShow()
$control=Yii::app()->runController('site/show');
redirect使用方法
$this->redirect(array('/site/contact','id'=>12));
//http://www.localyii.com/testwebap/index.php?r=site/contact&id=12
$this->redirect(array('site/contact','id'=>'idv','name'=>'namev'));
//http://www.localyii.com/testwebap/index.php?r=site/contact&id=idv&name=namev
$this->redirect(array('site/contact','v1','v2','v3'));
//http://www.localyii.com/testwebap/index.php?r=site/contact&0=v1&1=v2&2=v3
$this->redirect(array('site/contact','v1','v2','v3','#'=>'ttt'));
//带anchor的 http://www.localyii.com/testwebap/index.php?r=site/contact&0=v1&1=v2&2=v3#ttt
跳转到一个绝对路径
$this->redirect('http://www.baidu.com');
更多:
http://blog.csdn.net/qmhball/article/details/8031833
Yii框架下不同contoller之间的方法调用的更多相关文章
- Yii框架下使用redis做缓存,读写分离
Yii框架中内置好几个缓存类,其中有memcache的类,但是没有redis缓存类,由于项目中需要做主从架构,所以扩展了一下: /** * FileName:RedisCluster * 配置说明 * ...
- xampp下安装yii框架下遇到的问题
用yii框架来生成web目录是输入E:\xampp\htdocs\yii\framework/yiic webapp E:\xampp\htdocs\web 时提示php不是内部命令,也不是... 这 ...
- YII框架下实现密码修改
YII2 实现修改密码功能 主要难点: 1.密码加密 YII2对密码加密生成的结果是不同的,即用相同的初始密码在不同时间得到的加密结果不同,所以我们不能用常用的方法去验证密码是否正确(将密码加密后与数 ...
- yii框架下使用redis
1 首先获取到 yii2-redis-master.zip 压缩包 下载地址https://github.com/yiisoft/yii2-redis/archive/master.zip 2 把下载 ...
- SSH实战 · 用spring框架下的hibernatetemplate的get方法出现的问题
用get方法查询: return this.getHibernateTemplate().get(Product.class, pid); 出现错误为:id to load is requi ...
- yii框架下jquery在ajax更新后失效问题
解决方案,以live的形式重新绑定一次, /***回复隐藏收起效果***/ $(".btn-reply").live('click',function(event){ var da ...
- go微服务框架go-micro深度学习(四) rpc方法调用过程详解
上一篇帖子go微服务框架go-micro深度学习(三) Registry服务的注册和发现详细解释了go-micro是如何做服务注册和发现在,服务端注册server信息,client获取server的地 ...
- WinForm - 两个窗体之间的方法调用
方法1: 所有权法//Form1://需要有一个公共的刷新方法public void Refresh_Method(){ //...} //在调用Form2时,要把Form2的所有者设为F ...
- html中 iframe子页面 与父页面之间的方法调用 ;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- iOS-UIResponse之事件响应链及其事件传递
UIResponse之事件响应链及其事件传递 我们的App与用户进行交互,基本上是依赖于各种各样的事件.一个视图是一个事件响应者,可以处理点击等事件,而这些事件就是在UIResponder类中定义的. ...
- media query
accepted Another useful media feature is device-aspect-ratio. Note that the iPhone 5 does not have a ...
- warning:This application is modifying the autolayout engine from a background thread
警告提示:This application is modifying the autolayout engine from a background thread, which can lead to ...
- Usaco 2010 Dec Gold Exercise(奶牛健美操)
/*codevs 3279 二分+dfs贪心检验 堆版本 re一个 爆栈了*/ #include<cstdio> #include<queue> #include<cst ...
- RSA签名验签
import android.util.Base64; import java.security.KeyFactory; import java.security.PrivateKey; import ...
- node 搭建开发框架express
参考地址: http://www.itnose.net/detail/6095003.html 开发环境 E:\project> node -v v0.10.30 E:\project> ...
- [笔记]SD卡相关资料
ESD静电放电模块 我知道的flash分为两种NOR flash和NAND flash,NOR falsh容量一般为1~16M用于单片机代码存储,NAND flash最小的是8M最大的现在听说有90G ...
- HashMap HashTable HashSet
原文转载自 http://blog.csdn.net/wl_ldy/article/details/5941770 HashMap是新框架中用来代替HashTable的类 也就是说建议使用HashMa ...
- linux创建用户
创建用户 sudo adduser xxx 删除用户 sudo userdel xxx 删除用户和目录 sudo userdel -r xxx
- Win10获取管理员/administrator权限的方法
与Win7不同,Win10右键文件夹菜单,是没有“获取管理员权限”这个功能的,但是有时候我们偏偏需要用到这个功能,怎么办呢,可以按照这个办法实现:把下面的这一段代码复制下来放在文本文档中,然后另存为. ...