How To Set Width And Height Of Profile Image.

Hi, this is my code, I can preview the profile image, but I can’t set the width and height of the image. Can someone fix it…?


<?php echo CHtml::image(Yii::app()->request->baseUrl.'/avatar/'.$model->avatar, "this is alt tag of image"); ?>

You can pass HTML options as an array.




<?php echo CHtml::image(Yii::app()->request->baseUrl.'/avatar/'.$model->avatar, "this is alt tag of image", array('height'=>'150', 'width'=>'150')); ?>



The same idea is valid for pretty much all the CHtml class methods.

http://www.yiiframework.com/doc/api/1.1/CHtml#image-detail