Giter VIP home page Giter VIP logo

nette-table's Introduction

Table

Installation

$ composer require geniv/nette-table

or

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

require:

"php": ">=5.6.0",
"nette/nette": ">=2.4.0",
"dibi/dibi": ">=3.0.0",
"geniv/nette-locale": ">=1.0.0"

Include in application

neon configure:

services:
    - Table(%tablePrefix%)

usage:

use Table;

protected function createComponentTable1(Table $table)
{
    $table->setTemplatePath(__DIR__ . '/templates/Byty/cenikTable.latte')
        ->setTableName(PriceList::TABLE_NAME)
        ->setTableName(PriceList::TABLE_NAME, 'tab')
        ->setColumns('designation, floor')
        ->setColumns(['designation', 'floor'])
        ->setColumnLocale(null)     //<-default value is null
        ->setColumnLocale('language_col')
        ->addJoin('table_join', 'alias', 'alias.id=tab.id')
        ->addLeftJoin('table_join', 'alias', ['alias.id' => 'tab.id'])
        ->addLeftJoin('table_has_locale', 'lo_alias', 'lo_alias.id=tab.id AND lo_alias.id_locale=' . $table->getIdLocale())
        ->addWhere('image=1')
        ->addWhere('image=3')
        ->addWhere(['image' => 3])
        ->addOrder('position')
        ->addOrder('position', 'desc');
        
        // $table->getList()
        
    $table->enableCache(true)
        ->setCacheDependencies([Nette\Caching\Cache::EXPIRE => '30 minutes']);

    return $table;
}

usage:

{control table1}

usage in template:

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

{if $iterations==0}
    0 položek
{/if}

nette-table's People

Contributors

geniv avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.