Problem With Chtml::image With Htmloptions

This code does not render attributes as wanted:

echo CHtml::image('', '', array(

    'data-original' => 'original',

    'another-attribute' => 'bla-bla-bla',



<img src="" another-attribute data-original alt/>

I’m using last version of chrome, and the previous version of Yii (i will edit version later)

Someone else has posted the very same problem: Stackoverflow

are you trying to put the alternative text display(alt).

it should be pass as diffrent parameter,i think it can’t be given via htmloptions

I am using following.

echo CHtml::image(‘’, ‘No Image’, array(

'data-original' =&gt; 'original',

'another-attribute' =&gt; 'bla-bla-bla',


If image not found then "No Image" text will be displayed. Try It.


Ravi Bhalodiya.

[color="#006400"]/* moved from Bug Discussions */[/color]