2017 © Pedro Peláez
 

yii2-extension yii2-lazy-loading-module

Yii2 module for content lazy loading

image

denar90/yii2-lazy-loading-module

Yii2 module for content lazy loading

  • Wednesday, January 7, 2015
  • by denar90
  • Repository
  • 1 Watchers
  • 2 Stars
  • 88 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

Lazy loading Module for Yii2

Yii2 module for content lazy loading, (*1)

Main features: * showing items mode. Probability to use both in backend and in frontend * flexible module configuration, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

  • Either run
php composer.phar require --prefer-dist "denar90/yii2-lazy-loading-module": "dev-master"

or add, (*4)

"denar90/yii2-lazy-loading-module": "dev-master"

to the require section of your application's composer.json file., (*5)

  • Add a new module in modules section of your application's configuration file, for example:
'modules' => [
    'lazyloading' => [
        'class' => 'denar90\lazyloading\LazyLoading',
        'modelNamespace' => '\app\models\Items' \\ your model with items
    ],
],

This configuration will show only list, without links on each item. Mode by default is 'list'., (*6)

  • Mode 'view' configurations, for example:
'modules' => [
    'lazyloading' => [
        'class' => 'denar90\lazyloading\LazyLoading',
        'modelNamespace' => '\app\models\Items', \\ your model with items
        'mode' => 'edit',
        'additionalLinks' => [
            'view' => [
                'controller' => 'yourController',
                'action' => 'yourViewAction'
            ]
        ]
    ],
],
  • Mode 'edit' configurations, for example:
'modules' => [
    'lazyloading' => [
        'class' => 'denar90\lazyloading\LazyLoading',
        'modelNamespace' => '\app\models\Items', \\ your model with items
        'mode' => 'edit',
        'additionalLinks' => [
            'view' => [
                'controller' => 'yourController',
                'action' => 'yourViewAction'
            ],
            'delete' => [
                'controller' => 'yourController',
                'action' => 'yourDeleteItemAction'
            ]
        ]
    ],
],

Usage

In your action call module, (*7)

For example:, (*8)

...
    public function actionIndex() {
        $lazyLoading = Yii::$app->getModule('lazyloading');
        return $lazyLoading->runAction('lazyloading/index');
    }
...

Also you should create method in your model for getting list of items. For example:, (*9)


namespace app\models\Items; ... public function getAllItems($limit = 10, $offset = 0) { return $this->find()->offset($offset)->limit($limit)->all(); } ...

The Versions

07/01 2015

dev-master

9999999-dev

Yii2 module for content lazy loading

  Sources   Download

MIT

The Requires

 

yii2 module lazy loading

05/01 2015

dev-dev

dev-dev

Yii2 module for content lazy loading

  Sources   Download

MIT

The Requires

 

yii2 module lazy loading