chrisb34/yii2-lazyload

Yii2 helper to lazy load images and/or to convert image captions into div markups (like wordpress)

Installs: 83

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 0

Open Issues: 0

Language:JavaScript

Type:yii2-extension

dev-master 2017-07-11 10:34 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:20:34 UTC


README

Yii2 helper to lazy load images and/or to convert image captions into div markups (like wordpress)

*Note: This project is still in DEV and is therefore not fully tested / stable

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist chrisb34/yii2-lazyload "*"

or add

"chrisb34/yii2-lazyload": "*"

to the require section of your composer.json file.

Usage

In a view add the lazyload widget as follows;

use chrisb34/lazyload;

echo LazyLoad::widget([
        // the data model
        'model' => $model
        // the model attribute that holds the html to convert
        'contentProperty' => 'attributeName',

        ... other config options - see source code 
    ]) 

see http://yii2.chris-backhouse.com for more details

  • Thanks to

This uses the jquery plugins:

Lazy Load Plugin for jQuery - Mika Tuupola http://www.appelsiini.net/projects/lazyload

jCaption: jQuery Image Captions with Customizable Markup, Style and Animation - Joel Sutherland http://www.newmediacampaigns.com/blog/jcaption-a-jquery-plugin-for-simple-image-captions#download