PHPackages                             carrooi/no-grid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. carrooi/no-grid

ActiveLibrary[Framework](/categories/framework)

carrooi/no-grid
===============

Not a grid for Nette framework

2.0.2(9y ago)65.0k2[6 issues](https://github.com/Carrooi/Nette-NoGrid/issues)MITPHPPHP &gt;=5.6

Since Jul 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Carrooi/Nette-NoGrid)[ Packagist](https://packagist.org/packages/carrooi/no-grid)[ Docs](https://github.com/Carrooi/Nette-NoGrid)[ RSS](/packages/carrooi-no-grid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (6)Used By (0)

[![Build Status](https://camo.githubusercontent.com/f28441eddf26dac7fe195b9b678b5f4589615f977b3139913ddddd36fc77a150/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f436172726f6f692f4e657474652d4e6f477269642e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Carrooi/Nette-NoGrid)[![Donate](https://camo.githubusercontent.com/7f8b0c0980ad316210d1ec0c7d3298ace87d2f7c0eb6911977c0644951af5bd2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d50617950616c2d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T9SAY3LZL3YAA)

NoGrid
======

[](#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!
---------

[](#bc-break)

Be careful, this package was completely rewritten with version 2.0.0. Please read the new readme.

Features
--------

[](#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
------------

[](#installation)

```
$ composer require carrooi/no-grid

```

Now you can register Nette's extension

```
extensions:
    grid: Carrooi\NoGrid\DI\NoGridExtension
```

Configuration
-------------

[](#configuration)

```
grid:
    itemsPerPage: 20
    paginator:
        template: %appDir%/paginator.latte
        templateProvider: App\Grid\TemplateProvider
```

- `itemsPerPage`: default is 10
- `paginator/template`: not required
- `paginator/templateProvider`: class name for template provider, must be an instance of `Carrooi\NoGrid\IPaginatorTemplateProvider` interface. Not required

Definition
----------

[](#definition)

```
use Carrooi\NoGrid\DataSource\ArrayDataSource;
use Nette\Application\UI\Presenter;

class BooksPresenter extends Presenter
{

	/** @var \Carrooi\NoGrid\INoGridFactory @inject */
	public $gridFactory;

	protected function createComponentBooksGrid()
	{
		$dataSource = new ArrayDataSource([			// Read more about data sources below
			['title' => 'Lord of the Rings'],
			['title' => 'Harry Potter'],
			['title' => 'Narnia'],
		]);

		$grid = $this->gridFactory->create($dataSource);

		return $grid;
	}

}
```

Transform data loaded from data source
--------------------------------------

[](#transform-data-loaded-from-data-source)

```
$grid->transformData(function($line) {
	return [
		'id' => $line->getId(),
		'title' => $line->getTitle(),
	];
});
```

Printing
--------

[](#printing)

```

			Title

			{$line[title]}

			Display {$noGrid->getCount()} items from {$noGrid->getTotalCount()}

			{control booksGrid:paginator}
			No data found...

```

### Latte macros

[](#latte-macros)

- `no-grid`: Begin grid rendering (similar to [{form}](http://doc.nette.org/cs/2.3/forms#toc-manualni-vykreslovani) macro)
- `no-grid-data-as`: Iterate over data from data source and save current line to given variable
- `no-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 data
- `no-grid-empty`: Content will be processed only if there are no data
- `no-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
-----

[](#views)

Imagine that you want to create for example two tabs - "Active books" and "Sold books". This can be easily done with views.

**Definition:**

```
protected function createComponentBooksGrid()
{
	$dataSource = new ArrayDataSource([			// Read more about data sources below
		[
			'title' => 'Lord of the Rings,
			'sold' => true,
		'],
		[
			'title' => 'Harry Potter,
			'sold' => false,
		'],
		[
			'title' => 'Narnia,
			'sold' => false,
		'],
	]);

	$grid = $this->gridFactory($dataSource);

	$grid->addView('active', 'Active', function(array &$data) {
		$data = array_filter($data, function($book) {
			return !$book['sold'];
		});
	});

	$grid->addView('sold', 'Sold out', function(array &$data) {
		$data = array_filter($data, function($book) {
			return $book['sold'];
		});
	});

	return $grid;
}
```

**Display:**

```

				{$view->getTitle()}

```

Filtering
---------

[](#filtering)

**Supported conditions:**

- `Condition::SAME` (default)
- `Condition::NOT_SAME`
- `Condition::IS_NULL`
- `Condition::IS_NOT_NULL`
- `Condition::LIKE`

```
$form = new Form;
$form->addText('name');
$form->addSubmit('search', 'Search!');

$grid->setFilteringForm($form);

// setting filters is not required
$grid->addFilter('name', Condition::LIKE, [
	Condition::CASE_INSENSITIVE => true,
], function($name) {

	// update value before sending query to database
	return '%'. $name. '%';
});
```

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
------------

[](#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)`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~166 days

Total

5

Last Release

3289d ago

Major Versions

1.1.0 → 2.0.02017-05-17

PHP version history (2 changes)1.1.0PHP &gt;=5.4.0

2.0.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/838c6933d498fdb2a31f251ed45006a6ef97935ea2a27f38dab7738038939fc9?d=identicon)[david\_kudera](/maintainers/david_kudera)

---

Top Contributors

[![davidkudera](https://avatars.githubusercontent.com/u/1174072?v=4)](https://github.com/davidkudera "davidkudera (52 commits)")[![mrtnzlml](https://avatars.githubusercontent.com/u/978368?v=4)](https://github.com/mrtnzlml "mrtnzlml (2 commits)")[![northys](https://avatars.githubusercontent.com/u/2878126?v=4)](https://github.com/northys "northys (2 commits)")

---

Tags

nettedatagridtablesource

### Embed Badge

![Health badge](/badges/carrooi-no-grid/health.svg)

```
[![Health](https://phpackages.com/badges/carrooi-no-grid/health.svg)](https://phpackages.com/packages/carrooi-no-grid)
```

###  Alternatives

[ublaboo/datagrid

DataGrid for Nette Framework: filtering, sorting, pagination, tree view, table view, translator, etc

2971.9M23](/packages/ublaboo-datagrid)[o5/grido

Grido - DataGrid for Nette Framework

87290.5k4](/packages/o5-grido)[nette/web-project

Nette: Standard Web Project

10991.8k](/packages/nette-web-project)[nasext/dependent-select-box

Dependent Select Box for Nette Framework.

21262.8k2](/packages/nasext-dependent-select-box)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
