Question

In my web application I need to upload images from my system and use it in Yiistrap carausel. I copied the image into my images directory and gave the address .But its not recognizing , its not showing the image although I gave the correct adress of my image My code for using the image in Yiistrap widgets.

<?php echo TbHtml::carousel(array(
    array('image' => '/var/www/store3/images/download.jpg/830x477', 'label' => 'First Thumbnail label', 'caption' => 'image1'),
    array('image' => '/var/www/store3/images/download1.jpg/830x477', 'label' => 'Second Thumbnail label', 'caption' => 'image2'),

)); ?>

I also tried all combinations by removing the full path naming ,adding the relative path , but nothing seems to work .

The error I am getting is..

Failed to load resource: the server responded with a status of 404 (Not Found) Any body kindly help me with this .I am stuck up

Was it helpful?

Solution

Try this. It worked at my end. Using Yii's baseurl is the best way to reference directories.

<?php echo TbHtml::carousel(array(
array('image' => Yii::app()->request->baseUrl.'/images/download.jpg', 'label' => 'First Thumbnail label', 'caption' => 'image1'),
array('image' => Yii::app()->request->baseUrl.'/images/download1.jpg', 'label' => 'Second Thumbnail label', 'caption' => 'image2'),
)); ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top