Problem with rendered image

Hi to all,

I’m new to Yii and have a problem with a widget I made.

I have an action which generates an image, added the action to my sitecontroller and like the to display the image in the widget with


$myAction ='myaction';

public function run()

{   

    $url=$this->getController()->createUrl($this->myAction,array('v'=>uniqid()));

    CHtml::image( $url,'');

}



But the image is never displayed. The widget run function is called, but it seems that the controller is not calling my action.

When I enter ‘localhost/index.php?r=site/myaction’ in the browser everything works fine, the image is displayed, what means that the action class is called by the controller and is working as expected.

I tried than this extension ETextImage but it seems that there is the same issue.

What could be the problem here?

Thanks in advance

Frank

Should be echo CHtml::image( $url,’’);

/Tommy

This was just a typo, I use echo in my code, but I found the bug now.

I’m loading some other file in my action, where the path was wrong. In this case there was no error message and no display of the image. I’ve seen now that I should take more often a look in the application.log, which pointed me in the right direction.

Thanks for your help

Frank