Search code examples
yiijcarouselyii-extensions

JCarousel widget on Yii framework don't load image


I'm trying to use JCarousel widget on Yii framework.

My JCarousel must show images of specific user that belong to a specific gallery (for that user). I retrieve the information about the images from a MySQL DB, in the specific from Photos table, where gallery_id have a determined value. The column from Photos table that contain the name of the photos is "path".

In the code I have written this:

$DataProvider = new CActiveDataProvider('Photos', array('criteria'=>array(
                                        'condition'=>'gallery_id = :id',
                                        'params'=>array(':id'=>$gallery->id),
                                   ),));

$this->widget('ext.JCarousel.JCarousel', array(
                   'dataProvider' => $DataProvider,
                   'thumbUrl' => '"/images/upload/".$data->id."_".$data->path',
                   'imageUrl' => '"/images/upload/".$data->id."_".$data->path',
                   'target' => 'big-gallery-item',
                   'vertical' => false,
         ));

With this code I get, on the div, the written message: "No result find"

Where I did i go wrong?


Solution

    • Check your dataProvider. Try get results via $DataProvider->getData() and check that you photos exists.

    I do not think that the error in the extension, most likely you do not select data from the database.