Php 在Yii内创建facebook或其他网站的图像链接
我正在尝试制作一个图像,将用户链接到一个新网站,例如facebook.com。到目前为止,这是我得到的Php 在Yii内创建facebook或其他网站的图像链接,php,yii,Php,Yii,我正在尝试制作一个图像,将用户链接到一个新网站,例如facebook.com。到目前为止,这是我得到的 $imghtml=CHtml::image('images/imageSlider/397498913','Test'); echo CHtml::link($imghtml, $this->createAbsoluteUrl('https://www.facebook.com/')); 这确实会在网站上显示图像,但链接是错误的,当我单击此链接时,我会转到以下链接http://loca
$imghtml=CHtml::image('images/imageSlider/397498913','Test');
echo CHtml::link($imghtml, $this->createAbsoluteUrl('https://www.facebook.com/'));
这确实会在网站上显示图像,但链接是错误的,当我单击此链接时,我会转到以下链接<代码>http://localhost:63342/France2014/index.php?r=https://www.facebook.com
如何使其链接到facebook?只需使用
echochtml::link($imghtml,'https://www.facebook.com/');代码>
方法createUrl()
始终在应用程序内创建内部Yii链接。请尝试以下操作-
$imghtml=CHtml::image('images/imagesslider/397498913','Test');
echo-CHtml::link($imghtml,CHtml::normalizeUrl('https://www.facebook.com/'));
希望它能对您有所帮助。您好,很抱歉重播太晚,是的,谢谢您为我修复了它,谢谢您的帮助。