Yii Framework Forum: Tbthumbnails Using Array Of Image Urls - Yii Framework Forum

Jump to content

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

Tbthumbnails Using Array Of Image Urls Rate Topic: -----

#1 User is offline   Utopian 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 10-September 13

Posted 21 July 2014 - 03:52 AM

I'm trying to use TbThumbnails to show images from a directory. Below is my code.

$this->widget('bootstrap.widgets.TbThumbnails', array(
'dataProvider'=>new CArrayDataProvider(array('images'=>array('1'=>'/../images/carousel/1.jpg','2'=>'/../images/carousel/ground-2.jpg'))),
'template'=>"{items}\n{pager}",
'itemView'=>'_thumbs',
));

And my _thumbs.php is:
<li class="span3">
<?php var_dump($data); ?>
<img src="<?php echo $data['images'] ?>" alt="<?php echo $data ?>">
</li>

My error is:
Undefined index: images

How do I access the image urls here?
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