Question

I cannot display images I have entered in my application: enter image description here

Here is my code: /protected/views/site/index.php

<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name;
?>

<h1>Welcome to <i><?php echo CHtml::encode(Yii::app()->name); ?></i></h1>

<p>Congratulations! You have successfully created your Yii application.</p>

<p>For more details on how to further develop this application, please read
the <a href="http://www.yiiframework.com/doc/">documentation</a>.
Feel free to ask in the <a href="http://www.yiiframework.com/forum/">forum</a>,
should you have any questions.</p>

<?php $this->widget('bootstrap.widgets.TbCarousel', array(
'items'=>array(
    array(
    'image'=>'/../images/1.jpg',
    'label'=>'First Thumbnail label',
    'caption'=>'ooo'),
    array(
    'image'=>'/../images/2.jpg',
    'label'=>'Second Thumbnail label',
    'caption'=>'weee'),
    array(
    'image'=>'/../images/3.jpg',
    'label'=>'Third Thumbnail label',
    'caption'=>'pooops'),
  ),
)); ?>

I have put the images file on the right directory. Any suggestions for me? thanks

No correct solution

OTHER TIPS

<?php $this->widget('bootstrap.widgets.TbCarousel', array(
'items' => array(
 array(
        'image' => 'images/one.jpg',
        'label' => '',
        'caption' => ''),
    array(
        'image' => 'images/two.jpg',
        'label' => '',
        'caption' => ''),
    array(
        'image' => 'images/three.jpg',
        'label' => '',
        'caption' => ''),
),

)); ?>

make sure you have your images in www/wamp/project/images

you could try:

array('image' => Yii::app()->request->baseUrl.'/images/photo.jpg', 'label' => 'projektet', 'caption' => 'teksti'),
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top