PHPackages                             necktie/newsletter - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. necktie/newsletter

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

necktie/newsletter
==================

Necktie Newsletter bundle

00PHP

Since Jan 15Pushed 10y ago3 watchersCompare

[ Source](https://github.com/modpreneur/necktie-newsletter)[ Packagist](https://packagist.org/packages/necktie/newsletter)[ RSS](/packages/necktie-newsletter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Trinity Grid

Trinity grid is part of Trinity package.

Description:

- Converts an array of entities to array of strings.
- Array of string is convert to JSON:

\##Documentation

\###1) Create Grid

Create class extended by BaseGrid. Add templates for change attributes value.

```
class ProductGrid extends BaseGrid
{
    public function setUp()
    {
        $this->addTemplate("ProductGrid.html.twig");
    }
}

```

\####Set up addTemplate - add new template for changing values. setColumnFormat - for basic chage value of date or simple text edit.

Template:

cell\_attributeName for change value.

```
{% block cell_name %} Template edit - {{ value }} {% endblock %}

```

Available variables are: - value - row - entity object

\###2) Register grid

File: services.yml

```
services:
  trinity.grid.test.product:
    class: Trinity\Bundle\GridBundle\Tests\Functional\Grid\ProductGrid
    tags:
        - { name: trinity.grid, alias: product }

```

Tag name: trinity.grid
Alias is mandatory value for searching grids from entity name.

Product entity has product alias.

\####Grid filters

Filters are used to change the attribute values.

\#####Special grid:

Special filters are used for changing specific attribute (id, name, etc.).

1. Create filter:

Filter -&gt; BaseFilter or FilterInterface!

Attribute 'name' is necessary!

```
class IdFilter extends BaseFilter
{

    /**
     * @var string
     */
    protected $name = 'id';

    /**
     * @param string|object|int|bool $input
     * @param array $arguments
     * @return string
     */
    function process($input, array $arguments = []) : string
    {
        return $input.'.';
    }
}

```

2. Grid registration:

File: service.yml Tag: trinity.grid.filter

trinity.grid.filter.id: class: Trinity\\Bundle\\GridBundle\\Filter\\IdFilter tags: - {name: "trinity.grid.filter"}

3. Set up filter for current grid:

    $this-&gt;setColumnFilter('id', 'id');

First attribute 'id' -&gt; column name.

Second attribute -&gt; filter name.

\#####Global filters

For global filter must be set attribute 'global' to TRUE;

Attribute 'name' is not necessary.

```
class ObjectFilter extends BaseFilter
{
    protected $global = true;

    /**
     * @param string|object|int|bool $input
     * @param array $arguments
     * @return string
     */
    function process($input, array $arguments = []) : string
    {

        if ((is_object($input) && method_exists($input, 'getName'))) {
            $input = $input->getName();
        } elseif (is_object($input)) {
            $input = (string)$input;
        }

        return $input;
    }
}

```

\###3) Parse entity array to array of strings

From container pull service 'trinity.grid.manager'

```
$manager = $container->get('trinity.grid.manager');

```

Parse array of entities:

```
$stringArray = $manager->convertEntitiesToArray(
            $this->getArrayOfEntities(),                                        // array of entities
            ['id', 'name', 'description', 'nonexistentColumn', 'createdAt']     // columns
        );

```

From the entity name is found grid. $stringArray is must be convert to JSON.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/44273a4ac0f029f29c2e5f37a72fbf0a0059927d2674a7417d8f14066e3c75e6?d=identicon)[modpreneur](/maintainers/modpreneur)

### Embed Badge

![Health badge](/badges/necktie-newsletter/health.svg)

```
[![Health](https://phpackages.com/badges/necktie-newsletter/health.svg)](https://phpackages.com/packages/necktie-newsletter)
```

PHPackages © 2026

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