Reputation: 1997
i have stored pdf.png in C:\wamp\www\pipelinespark\images\pdf.png
i have used $imghtml=CHtml::image('pdf.png');
then i getting error like.
"NetworkError: 404 Not Found - pipelinespark/administrator/index.php/spark/pdf.png".
Thanks in advance.
Upvotes: 3
Views: 8374
Reputation: 38552
All of them works for me
<?=CHtml::image(Yii::app()->request->baseUrl."/path-to-images/logo.png", "LOGO")?>
<?=CHtml::image(Yii::app()->baseUrl."/path-to-images/logo.png")?>
<?php echo CHtml::image(Yii::app()->basePath."/../images/profile-image/".$data->avatar); ?>
Upvotes: 0
Reputation: 1
<?php echo CHtml::image(Yii::app()->baseUrl . "/images/" . $data->image); ?>
Where $data
is the returned value form actionIndex
Upvotes: 0
Reputation: 8146
This works for me!
<?php
echo CHtml::image(Yii::app()->request->baseUrl.'/path_to/images /'."$model->logo","$model->Name",array('width'=>100,'height'=>100));?>
Upvotes: 5