1. Christoffer Niska
  2. yii-bootstrap
  3. Issues
Issue #220 new

add option 'url' to Carousel

Peter Kambey
created an issue

i want to make image on carousel clickable, could you modify line 146 on carousel be like this....

if (isset($item['url'])) { echo CHtml::link(CHtml::image($item['image'], $item['alt'], $item['imageOptions']),$item['url']); } else echo CHtml::image($item['image'], $item['alt'], $item['imageOptions']);

Comments (1)

  1. yasen_petrov

    Just wanted to suggest such improvement too. Something like:

    $imgHtml=CHtml::image($item['image'], $item['alt'], $item['imageOptions']);
    echo isset($item['href']) ? CHtml::link($imgHtml,$item['href']) : $imgHtml;

    where the image html is outputed

  2. Log in to comment