\pm_View_Helper_ActiveList

Helper for rendering active list

Summary

Methods
Properties
Constants
activeList()
setData()
setLayout()
setLocale()
No public properties found
LAYOUT_AUTO
LAYOUT_RESPONSIVECOLUMN
No protected methods found
$_componentType
$_localeSection
N/A

Constants

LAYOUT_AUTO

LAYOUT_AUTO

LAYOUT_RESPONSIVECOLUMN

LAYOUT_RESPONSIVECOLUMN

Properties

$_componentType

$_componentType : 

Type

$_localeSection

$_localeSection : 

Type

Methods

activeList()

activeList(array  $options = array()) : $this

Render active list

$this->activeList([
    'data' => array,
    'layout' => string|array,
    'locale' => array,
]);

Parameters

array $options

Returns

$this

setData()

setData(array  $data) : $this

Set data

$this->activeList()->setData([
    [
        'id' => string,
        'icon' => string, // optional
        'title' => string,
        'type' => string // optional
        'labels' => [ // optional
            [
                'type' => string,
                'value' => string
            ],
            ...
        ],
        'primaryActions' => [ // optional
            [
                'title' => string,
                'link' => string,
            ],
            ...
        ],
        'summary' => [ // optional
            [
                'name' => string,
                'value' => string,
            ],
            ...
        ],
        'toolbar' => [ // optional
            [
                'title' => string,
                'iconClass' => string,
                'link' => string,
            ],
            ...
        ],
        'services' => [ // optional
            [
                'title' => string,
                'icon' => string,
                'link' => string,
                'toolbar' => [ // optional
                    [
                        'title' => string,
                        'link' => string,
                    ],
                    ...
                ],
                'messages' => [ // optional
                    [
                        'icon' => string, // optional
                        'info' => string,
                        'noEscape' => bool, // optional, default is false
                    ],
                    ...
                ],
            ],
            ...
        ],
        'additionalHtml' => string, // optional
        'actions' => [ // optional
            [
                'title' => string,
                'icon' => string,
                'link' => string,
            ],
            ...
        ],
    ],
    ...
]);

Parameters

array $data

Returns

$this

setLayout()

setLayout(string|array  $layout) : $this

Set the layout for items. Layout may be specified as either as a String or as an Object:

Specify as a String

$this->activeList()->setLayout(pm_View_Helper_ActiveList::LAYOUT_RESPONSIVECOLUMN);

Specify as an Object

$this->activeList()->setLayout([
    'type' => pm_View_Helper_ActiveList::LAYOUT_RESPONSIVECOLUMN,
    'stretched' => true,
    'columns' => 'xl-2 xxl-3',
]);

The type option can take the following values pm_View_Helper_ActiveList::LAYOUT_AUTO (by default) or pm_View_Helper_ActiveList::LAYOUT_RESPONSIVECOLUMN

The pm_View_Helper_ActiveList::LAYOUT_RESPONSIVECOLUMN layout id a simple grid-like layout for proportionally dividing container space and allocating it to each item. You can set additional optional options stretched and columns for this layout type.

The stretched option is making elements the equal height in row.

The columns option is whitespace separated configuration of how many columns in list for specific viewport size in following format (sm|md|lg|xl|xxl|xxxl)-(1-6). For example, 'xl-2 xxl-3' means that there will be 2 columns when viewport is "xl" and 3 columns when viewport is "xxl".

Parameters

string|array $layout

Returns

$this

setLocale()

setLocale(array  $locale = array()) : $this

Set locale

$this->activeList()->setLocale([
    'noObjects' => $this->lmsg('noObjects'),
]);

Parameters

array $locale

Returns

$this