CHtml and iframe with external URL

I need to create FB tag with iframes, but I didn’t found any better solution that create my own function doing that.

Why Yii should create iframe tag

  • use URL AND/OR a route

  • easy & encoding (& or &)

  • params encoding

  • manage the presence of some parameters (eg.: http_//maps_google_com/maps?hl=it )

  • manage of htmlOptions

What I didn’t found in Yii is the possibilities to manage external links in a smart way. Did I miss something?

Any suggestion/idea is welcome



i use extension jqprettyphoto for iframe

my code :


// import the extension



$options = array(







// call addPretty static function

jqPrettyPhoto::addPretty('.gallery a',jqPrettyPhoto::PRETTY_GALLERY,jqPrettyPhoto::THEME_FACEBOOK, $options);


echo CHtml::link('Update Icon', MyModel::model()->urlIframe('/image/createIcon', array('id'=>$model->id),'900','400'),array('rel'=>'prettyPhoto')); 


in my model

public function urlIframe($view,$param,$width,$height)


		$link = Yii::app()->createUrl($view,$param);

		$link = $link."?iframe=true&width=".$width."&height=".$height;

		return $link;


sorry if it’s not useful…