开发者

Yii framework CHtml::link error jump to a named anchor in another page

开发者 https://www.devze.com 2023-03-23 22:18 出处:网络
I\'m use Yii Framework. I have a named anchor <a name=\"projet\">p开发者_Python百科rojet</a> in about.php page.

I'm use Yii Framework.

I have a named anchor <a name="projet">p开发者_Python百科rojet</a> in about.php page. I've created a link in the index page to the named anchor in the about page like that :

     <?php  echo CHtml::link('MyLink',array('site/page','view'=>'about#projet')); ?>

But when I click on the link "MyLink", I have an error 404 response with this message :

     The requested view "about#projet" was not found.

And in the url I have:

     localhost/myApps/index.php?r=site/page&view=about%23projet

I checked default charset application is UTF-8. So I don't understand why my link isn't well encoded. Someone can help me please?


try this:

echo CHtml::link('MyLink',array('site/page','view'=>'about', '#'=>'projet'));
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号