我需要在Yii中创建URL,并在页面上指定一个div,以便在单击时聚焦…我知道我需要在URL中使用#来设置div名称,但是如何在Yii的createUrl函数中指定…
@H_502_6@
如果你检查
createUrl:
根据我的知识,createUrl()函数只提供参数的选项,而不是元素的选项.
additional GET parameters (name=>value). Both the name and value will be URL-encoded. If the name is ‘#’,the corresponding value will be treated as an anchor and will be appended at the end of the URL.
您可以像这样添加它:
echo $this->createUrl('controller/action',array('#'=>'name'));