0

I am trying to create an external URL using the CHtml::link function but it always tries to create an internal link rather than an external link..

So rather than linking to google.com, it is linking to www.mysite.com/www.google.com

Any ideas (ps i know I could write this using standard HTML but i'd link to use the Yii engine as much as possible

Zabs
  • 13,852
  • 45
  • 173
  • 297

2 Answers2

2

This is an example on CHTML link that I used on an image... It linkes the image with google onclick.

CHtml::link( CHtml::image(Yii::app()->request->baseUrl . '/images/android.png'),('www.google.com'), array('class'=>" "));

Hope it helps!
Keep on coding!
Ares.

Ares Draguna
  • 1,641
  • 2
  • 16
  • 32
0
<?php echo CHtml::link('Text','http://www.example.com', array('class'=>''));?>

The HTTP protocol must have at the beginning of the domain.