2017 © Pedro Peláez
 

yii2-extension yii2-intercooler

Yii2 Intercooler extensions

image

dlds/yii2-intercooler

Yii2 Intercooler extensions

  • Monday, April 30, 2018
  • by dlds
  • Repository
  • 2 Watchers
  • 3 Stars
  • 1,444 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 5 % Grown

The README.md

Yii2 Intercooler integration

Easy integration of Intercooler.js (the easy to use Ajax handler) into Yii2 framework. Provides bunch of ready to use widgets with preddefined Intercooler requirements., (*1)

See Intercooler.js official docs on http://intercoolerjs.org, (*2)

Installation

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

Either run, (*4)

$ composer require dlds/yii2-intercooler

or add, (*5)

"dlds/yii2-intercooler": "~2.0"

to the require section of your composer.json file., (*6)

Module Base Class

Base module class Intercooler holds all options for Intercooler required html element attributes. Also handles registering of required js files using IntercoolerAssets. It is usually init through some of included widgets., (*7)

Response Headers

Using base class static methods you are allowed to set specific intercooler headers., (*8)

X-IC-Redirect

To be able to redirect user to new url after intercooler request is done you have to set redirect header in server side., (*9)

Intercooler::doRedirect('/new-destination-url');

X-IC-Refresh

To refresh intercooler elements you can set refresh header on your server side and tell intercooler which elements should be refreshed., (*10)

Intercooler::doRefresh([
    '/foo/bar'
]);

See what '/foo/bar' stand for in official docs, (*11)

X-IC-Remove

To remove targetted element you have to set remove header on server side., (*12)

Intercooler::doRemove();

Widgets

Integration comes with buch of ready made modules based on intercooler behavior., (*13)

AjaxBlock

Helper which renders appropriate html element with required intercooler attributes., (*14)

AjaxBlock::begin([
    'id' => 'my-ic-widget',
    'wrapper' => 'button',
    'options' => ['class' => 'text-gray']
    'intercooler' => [
        'url' => '/my-custom-url',
        'target' => '#my-target-element',
    ],
]);

// ... custom content

AjaxBlock::end();

For more widget options see AjaxBlock class documentation., (*15)

InfiniteList

Renderes Infinite ListView widget., (*16)

InfiniteList::widget([
    'id' => 'my-ic-infinite-list,
    //  ...
    //  standart ListView widget options
    //  ...
    'layout' => "{indicatorRefresh}<div class=\"items\">{items}{pager}</div>\n",
    'partialLayout' => "{items}{pager}\n",
    'intercooler' => [
        'url' => '/my-ic-feed-url,
        'type' => \dlds\intercooler\Intercooler::RQ_TYPE_SRC,
    ],
    'pager' => [
        'class' => InfiniteListPager::className(),
    ],
]);

For more widget options see InfiniteList class documentation., (*17)

The Versions

30/04 2018

dev-master

9999999-dev

Yii2 Intercooler extensions

  Sources   Download

MIT BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

30/04 2018

2.9

2.9.0.0

Yii2 Intercooler extensions

  Sources   Download

MIT

The Requires

 

by Jiri Svoboda

yii2 intercooler

30/04 2018

2.8

2.8.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

yii2 intercooler

11/03 2017

2.7

2.7.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

19/01 2017

2.6

2.6.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

18/11 2016

2.5

2.5.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

17/11 2016

2.4

2.4.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

10/11 2016

2.3

2.3.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

07/09 2016

2.2

2.2.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

29/08 2016

2.1

2.1.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

14/07 2016

2.0

2.0.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

27/06 2016

1.7

1.7.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

10/05 2016

1.6

1.6.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

28/04 2016

1.5

1.5.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

07/04 2016

1.4

1.4.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

05/04 2016

1.3

1.3.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

31/03 2016

1.2

1.2.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

30/03 2016

1.1

1.1.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler

29/03 2016

1.0

1.0.0.0

Yii2 Intercooler extensions

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

yii2 intercooler