thumbnailer Replace <img> tags on the fly with generated thumbnails and a link to the image. Useful with fancybox extension.

  1. Requirements
  2. Usage
  3. Resources
  4. Credits

Replace <img> tags on the fly with auto generated thumbnails and a link to the image. Useful with the fancybox extension.

Requirements

Yii 1.1 or above.

Usage

<?php $this->beginWidget('application.extensions.thumbnailer.Thumbnailer', array(

        'thumbsDir' => 'images/thumbs',
        'thumbWidth' => 200,
        'thumbHeight' => 150, // Optional
    )
); ?>

// This portion is captured by the widget
<img src="images/example.jpg" />
<img src="images/anotherExample.jpg" />
<img src="images/yetAnotherExample.jpg" />

// Replace the images with thumbnails
<?php $this->endWidget(); ?>

This outputs:-

[html]
<a href="images/example.jpg" rel="gallery">
    // The thumbnail images are created when the page is loaded for the first time!
    // To create the thumbnail, simpleimage is used.
    <img src="images/thumbs/example.jpg">
</a>
<a href="images/anotherExample.jpg" rel="gallery">
    <img src="images/thumbs/anotherExample.jpg">
</a>
<a href="images/yetAnotherExample.jpg" rel="gallery">
    <img src="images/thumbs/yetAnotherExample.jpg">
</a>

Resources

The following extension must be installed:-

Credits

  • phpQuery is used internally by the extension. A distribution of phpQuery is included in the zip file.
7 0
7 followers
1 597 downloads
Yii Version: 1.1
License: GPL-3.0
Category: User Interface
Developed by: Hindol
Created on: Jan 19, 2012
Last updated: 6 years ago

Downloads

show all

Related Extensions