zl程序教程

您现在的位置是:首页 >  后端

当前栏目

YII contoller之间的方法调用 redirect

方法 调用 之间 yii Redirect
2023-09-14 08:59:48 时间

一个contoller CustomerController里怎么调用另一个controller里的action,Acontoller调用SiteContoller的actionShow($id), url显示上是Customer/index


$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  
forward 是服务器请求资源,服务器直接访问目标地址的 url,把 url 的响应内容读取出来,然后把这些内容发送给浏览器,浏览器根本不知道服务器发送的内容是从哪取出来,所以他的地址栏中还是原来的地址。