well you can call the view and pass it some arguments from the action and display them there
e.g. (NOT TESTED)
<?php class TestController extends CController { public function actionIndex() { $filename = "test.jpg"; $path=Yii::getPathOfAlias('webroot.protected.images') . '/'; $file=$path.$filename; if (file_exists($file)) { $this->render('view',array( 'filepath'=>$file, )); } } ?>
and in view you can do something
echo CHtml::image(filepath, 'image', array('class' => 'banner'));
source share