geniv/nette-table-block

Table block component for Nette Framework

v1.0.0 2018-03-04 22:58 UTC

This package is auto-updated.

Last update: 2024-11-14 04:13:42 UTC


README

Installation

$ composer require geniv/nette-table-block

or

"geniv/nette-table-block": ">=1.0.0"

require:

"php": ">=7.0.0",
"nette/nette": ">=2.4.0",
"geniv/nette-general-form": ">=1.0.0"

Include in application

neon configure:

services:
    - TableBlock

usage:

protected function createComponentStudioBlock(TableBlock $tableBlock): TableBlock
{
    $studioBlock = clone $tableBlock;
    $studioBlock->setTemplatePath(__DIR__ . '/templates/Studio/studioBlock.latte');
    $studioBlock->addVariableTemplate('listStudio', $this->listStudio);
    return $studioBlock;
}

usage:

{control studioBlock}

usage in template:

<div n:foreach="$listStudio as $item">
    <h1>{$item['title']}</h1>
</div>

{if !$iterations}
    no items
{/if}