Yii Framework Forum: Problem With Chtml::image With Htmloptions - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem With Chtml::image With Htmloptions Rate Topic: -----

#1 User is offline   Babas007 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 03-January 13

Posted 08 January 2013 - 04:08 AM

This code does not render attributes as wanted:
echo CHtml::image('http://google.com/images/srpr/logo3w.png', '', array(
    'data-original' => 'original',
    'another-attribute' => 'bla-bla-bla',
));


Result:
<img src="http://google.com/images/srpr/logo3w.png" 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
0

#2 User is offline   francis ja 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 27-July 11
  • Location:India

Posted 28 January 2013 - 12:17 PM

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
skype: jesusloves.francis
Blogs:
http://yiideveloper.wordpress.com/
http://francis-yii-developer.me
Co-founder of Nintriva Wireless
mails:
jesusloves.francis@gmail.com
francis@nintriva.com
http://nintriva.com
0

#3 User is offline   Ravi Bhalodiya 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 27-August 12
  • Location:Gujarat India

Posted 06 April 2013 - 03:42 AM

I am using following.

echo CHtml::image('http://google.com/images/srpr/logo3w.png', 'No Image', array(
'data-original' => 'original',
'another-attribute' => 'bla-bla-bla',
));

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

Thankx.
Ravi Bhalodiya.
Regards
Ravi Bhalodiya.
0

#4 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 06 April 2013 - 08:16 AM

/* moved from Bug Discussions */
"Less noise - more signal"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users