Download the PHP package nerburish/yii2-masonry-view without Composer
On this page you can find all versions of the php package nerburish/yii2-masonry-view. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-masonry-view
Yii2 Masonry ListView Widget
Yii2 widget to extend the Yii2 ListView for use it as Masonry grid layout (http://masonry.desandro.com/)
Widget demo screenshot:
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
The usage is similar to default ListView Widget (http://www.yiiframework.com/doc-2.0/yii-widgets-listview.html)
You just need a dataProvider and prepare the item template for your model.
In clientOptions you can pass the Masonry options to modify the plugin behavior (see http://masonry.desandro.com/options.html)
You can also attach a cssFile for styling the grid.
Exemple
We have this model:
And this item template named _item.php:
Finally, in our view, we run the widget:
Below, the css used for the demo:
You may be interested in Isotope Widget because implements Masonry and other layouts and funcionalities at once. https://github.com/nerburish/yii2-isotope-view
There is also a MatchHeight.js implementation of ListView widget: https://github.com/nerburish/yii2-match-height-view