[EXTENSION] fancyBox2 Gallery

Hello all

I was in need of a “popup” gallery function for yii, and quickly found the fancyBox extension - though it turned out that i actually couldn’t get this to work as i wanted to.

So i decided to download the new fancyBox2, and create myself an extension (with the fancybox extension as template) that easily can output a gallery in fancybox…

No more talk.

Download the rar file from: http://www.2shared.com/file/wn3QsSje/fancybox2.html

Unzip to your extension folder.

In your view file:

<a class="open_fancybox"><div class="fancybox-button"></div></a>

<?php $this->widget('application.extensions.fancybox2.EFancyBox2', 


    'class'=>'open_fancybox', // The class where the fancybox will open from

    'url'=>Yii::app()->request->baseUrl.'/files/'.$galleryFolder->id.'/', // Url to the gallery where all the images are in

    'images'=>$galleryImages, // From the controller, found with "findAll" function.

    'emptyText'=>'bla bla bla', // **Optional

    'config'=>array( // **Optional - look the fancybox2 documentation for more information. http://fancyapps.com/fancybox/#docs




















); ?>

And in controller i personally use following:




Gladly write if you got any comments, or something you think should be changed.

But dont flame if you dont like it - just dont use it? :)

// Casper

Could be very useful thing since this extension is supported inactively. But it would be fine to get more usage instructions.

As I understood correctly, images need to be stored in database, not in local directory?

Would be great if you load the project to git. It will be convenient to other developers to support/improve this extension.