2017 © Pedro Peláez
 

yii2-extension yii2-columnlistview

Responsive columnar List View for Yii 2.x

image

circulon/yii2-columnlistview

Responsive columnar List View for Yii 2.x

  • Thursday, April 21, 2016
  • by circulon
  • Repository
  • 1 Watchers
  • 5 Stars
  • 1,372 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 2 Versions
  • 16 % Grown

The README.md

yii2-columnlistview

Yii 2.x ListView for building a responsive column layout, (*1)

This is ideal for portfolio style layout of model/s content, (*2)

Features

  • default settings for several common responsive layouts
  • easily configurable for custom layouts
  • generates fully responsive columns;

Installation

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

Either run, (*4)

$ php composer.phar require circulon/yii2-columnlistview "*"

or add, (*5)

"circulon/yii2-columnlistview": "*"

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

Basic usage

    use circulon\widgets\ColumnListView;

    echo ColumnListView::widget([
        'dataProvider' => $dataProvider,

        'columns' => 3, // default : 1
])

The above example will generate a listview with the following layout per device size - lg (Desktop) 4 columns - md (Tablet) 3 columns - sm (Phone) 2 columns - xs 1 column, (*7)

Advanced usage

Custom layout

Creating your own column layout is easy to do., (*8)

The setup of the columnsLayout var is as follows, (*9)

  'columns' => <column number>
  'columnsLayout' => [
    <column number> => [
      <column to break at> => <size to use>,
      <column to break at> => [<size to use>, <size to use>] 
      ...
    ],
    ...
  ],

NOTE: Unless otherwise specified SIZE_TINY ('xs') defaults to 1 column, (*10)

Generally I find it easier to layout columns for Tablet ('md' / SIZE_MEDIUM) then scale up for large and down for small and tiny devices., (*11)

Check the source for additional size layouts., (*12)

Custom CSS classes for columns

For example, if you want to render 3 columns using a custom CSS class:, (*13)

  <div class="row">
    ...
    <div class="col-lg-4 col-xs-12" data-key="...">
      ...
    </div>
    ...
  </div>

You must set up your widget as follows:, (*14)

  echo ColumnListView::widget([
    'dataProvider' => $dataProvider,
    'columns' => 3,
    'itemOptions' => [
      'class' => 'col-lg-4 col-xs-12',
    ],
  'itemView' => 'item',
  ]);

The Versions

21/04 2016

dev-master

9999999-dev https://github.com/circulon/yii2-columnlistview.git

Responsive columnar List View for Yii 2.x

  Sources   Download

MIT

The Requires

 

by Kieren Eaton

yii2 yii yii 2 responsive column listview columns list view circulon

28/06 2015

v1.0.0

1.0.0.0 https://github.com/circulon/yii2-columnlistview.git

Responsive columnar List View for Yii 2.x

  Sources   Download

MIT

The Requires

 

by Kieren Eaton

yii2 yii yii 2 responsive column listview columns list view circulon