Php Yii使用html id呈现页面
正如我所知,渲染是移动到另一个页面 例如:Php Yii使用html id呈现页面,php,yii,Php,Yii,正如我所知,渲染是移动到另一个页面 例如: $this->render('index'); // move to index.php 在普通HTML中,我们可以简单地根据自己的需要执行此操作,例如: $this->render('index'); // move to index.php 单击index.php#tab1将移动到位置tab1。。。伊伊呢 我尝试了$this->render('index#tab1')但不起作用。有什么建议吗?谢谢我试过这个,效果很好 $this-&
$this->render('index'); // move to index.php
在普通HTML中,我们可以简单地根据自己的需要执行此操作,例如:
$this->render('index'); // move to index.php
单击index.php#tab1
将移动到位置tab1
。。。伊伊呢
我尝试了
$this->render('index#tab1')代码>但不起作用。有什么建议吗?谢谢我试过这个,效果很好
$this->redirect(array('/site/index','#'=>'tab1'));
谢谢render()
方法将呈现完整的视图/{controller}/index.php
。我想你说的是链接,而不是render
method.@Justinas但是移动到索引并不是按链接单击。。。这个链接只是我的例子来解释我的想法want@TheSmile:URL的#
部分只能在客户端使用,因此Yii无法处理此问题…@TheSmile如果单击链接index.php#tab1
,浏览器将跳转到该位置。Yii(作为PHP框架)将只向用户输出视图文件renderPartial()
只能用于输出视图的单个部分,但它不会产生“跳转”效果。@不能通过Yii或任何其他基于服务器端的内容执行此任务。