Download the PHP package carrooi/no-grid without Composer
On this page you can find all versions of the php package carrooi/no-grid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package no-grid
NoGrid
Definitely not a grid, just a simple control for printing data in customized templates with paginator.
It's not a good thing to always just show some automatically generated grid with data, mainly in frontend and that package is for that moments.
BC Break!
Be careful, this package was completely rewritten with version 2.0.0. Please read the new readme.
Features
It has:
- Paginator with custom templates option
- Latte macros for simplified templates
- Views (eg. for archived and not archived data)
- Different data sources
- Filtering
It hasn't:
- Default grid template
- CSS styles
- JS scripts
- Sorting
- Forms
It may get some of these features in future.
Installation
Now you can register Nette's extension
Configuration
itemsPerPage
: default is 10paginator/template
: not requiredpaginator/templateProvider
: class name for template provider, must be an instance ofCarrooi\NoGrid\IPaginatorTemplateProvider
interface. Not required
Definition
Transform data loaded from data source
Printing
Latte macros
no-grid
: Begin grid rendering (similar to {form} macro)no-grid-data-as
: Iterate over data from data source and save current line to given variableno-grid-views-as
: Iterate over views from current NoGrid and save view data to given variable (see more about views below)no-grid-not-empty
: Content will be processed only if there are some datano-grid-empty
: Content will be processed only if there are no datano-grid-has-paginator
: Content will be processed only if paginator should be rendered
Also you can see that paginator can be rendered with {control booksGrid:paginator}
.
These latte macros can't be used as "non-attribute" macros, so there are also variants written in camelCase:
noGrid
noGridDataAs
noGridViewsAs
noGridNotEmpty
noGridEmpty
noGridHasPaginator
Views
Imagine that you want to create for example two tabs - "Active books" and "Sold books". This can be easily done with views.
Definition:
Display:
Filtering
Supported conditions:
Condition::SAME
(default)Condition::NOT_SAME
Condition::IS_NULL
Condition::IS_NOT_NULL
Condition::LIKE
Now you only have to display form inputs in your template.
Do not render beginning and end of the array, it is rendered automatically!
Data sources
Carrooi\NoGrid\DataSource\ArrayDataSource(array)
Carrooi\NoGrid\DataSource\Doctrine\DataSource(Doctrine\ORM\QueryBuilder)
Carrooi\NoGrid\DataSource\Doctrine\QueryObjectDataSource(Kdyby\Persistence\Queryable, Kdyby\Doctrine\QueryObject)
Carrooi\NoGrid\DataSource\Doctrine\QueryFunctionDataSource(Kdyby\Persistence\Queryable, Carrooi\NoGrid\DataSource\DoctrineQueryFunction)
All versions of no-grid with dependencies
nette/di Version ^2.4
nette/application Version ^2.4
nette/forms Version ^2.4
latte/latte Version ^2.4
kdyby/doctrine Version *