PHPackages                             m-adamski/symfony-helpers-bundle - 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. m-adamski/symfony-helpers-bundle

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

m-adamski/symfony-helpers-bundle
================================

Helpers Bundle for Symfony

2.0.3(7y ago)198MITPHPPHP ^7.1

Since Mar 8Pushed 7y agoCompare

[ Source](https://github.com/m-adamski/symfony-helpers-bundle)[ Packagist](https://packagist.org/packages/m-adamski/symfony-helpers-bundle)[ RSS](/packages/m-adamski-symfony-helpers-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (7)Dependencies (10)Versions (11)Used By (0)

Helpers Bundle for Symfony 4
============================

[](#helpers-bundle-for-symfony-4)

**This bundle is deprecated!** Each helper was moved into a separate package:

- [Breadcrumbs Bundle](https://github.com/m-adamski/symfony-breadcrumbs-bundle)
- [Directory Bundle](https://github.com/m-adamski/symfony-directory-bundle)
- [Mailer Bundle](https://github.com/m-adamski/symfony-mailer-bundle)
- [Notification Bundle](https://github.com/m-adamski/symfony-notification-bundle)
- [PDF Bundle](https://github.com/m-adamski/symfony-pdf-bundle)

---

A collection of tools to improve the implementation of frequently-repeated functionalities:

- Breadcrumbs Helper
- Directory Helper
- Mailer Helper
- Notification Helper
- Pagination Helper
- PDF Helper

Breadcrumbs Helper
------------------

[](#breadcrumbs-helper)

The Breadcrumbs tool simplifies the generation and display process of breadcrumbs.

### How to use it?

[](#how-to-use-it)

In the controller function, generate the breadcrumbs structure:

```
$this->breadcrumbsHelper->addRouteItem("Management", "administrator.index", [], "navigation");
$this->breadcrumbsHelper->addRouteItem("Data management", "administrator.data", ["id" => $id], "navigation");

```

To display breadcrumbs in Twig template file use `breadcrumbs()` function:

```

    {{ breadcrumbs() }}

```

### Functions

[](#functions)

- addItem(string $text, string $url = "", string $translationDomain = "breadcrumbs", array $translationParameters = \[\], bool $translate = true)
- addRouteItem(string $text, string $route, array $routeParameters = \[\], string $translationDomain = "breadcrumbs", array $translationParameters = \[\], bool $translate = true)
- addNamespaceItem(string $namespace, string $text, string $url = "", string $translationDomain = "breadcrumbs", array $translationParameters = \[\], bool $translate = true)
- prependItem(string $text, string $url = "", string $translationDomain = "breadcrumbs", array $translationParameters = \[\], bool $translate = true)
- prependRouteItem(string $text, string $route, array $routeParameters = \[\], string $translationDomain = "breadcrumbs", array $translationParameters = \[\], bool $translate = true)
- prependNamespaceItem(string $namespace, string $text, string $url = "", string $translationDomain = "breadcrumbs", array $translationParameters = \[\], bool $translate = true)
- getNamespaceBreadcrumbs(string $namespace = self::DEFAULT\_NAMESPACE)
- clear(string $namespace = "")

Directory Helper
----------------

[](#directory-helper)

The Directory tool was created for faster directory management. With its help, you can quickly create a list of all files in a folder, create a new folder or generate a file path.

Mailer Helper
-------------

[](#mailer-helper)

As the name says, the Mailer Helper is used to send email messages. Helper contain two functions:

- buildMessage(?string $subject = null, ?string $body = null, ?string $contentType = null, ?string $charset = null)
- sendMessage(MailerMessage $mailerMessage, ?array &amp;$failedRecipients = null)

The first function generates an instance of the MailerMessage class, which extends the basic class Swift\_Message. The other one tries to send the generated message.

### How to use it?

[](#how-to-use-it-1)

In the controller function just call `sendMessage` function with parameters:

```
$messageSubject = "This is example message";
$messageTemplate = "mail/Notification/notification.html.twig";

$messageData = [
    "template_parameter" => "Hello World!"
];

$messageAttachments = [
    $this->directoryHelper->generatePath([
        $this->directoryHelper->getPublicDirectory(), "download", "information.pdf"
    ], true)
];

// Send message
$this->mailerHelper->sendMessage(["john.sample@example.com"], $messageSubject, $messageTemplate, $messageData, $messageAttachments);

```

Notification Helper
-------------------

[](#notification-helper)

The tool is intended to help display information for the user.

### How to use it?

[](#how-to-use-it-2)

For example: An error occurred while creating a new blog entry and we would like to inform the user about it:

```
$this->notificationHelper->addNotification(
    NotificationHelper::ERROR_TYPE,
    $this->translator->trans("An error occurred while trying to create a entry", [], "blog")
);

```

As in the case of Breadcrumbs Helper, we must also add a call to the corresponding function in the template:

```

    {{ notification() }}

```

### Functions

[](#functions-1)

- addNotification(string $type, string $text)
- redirectNotification(string $url, string $type, string $text)
- routeRedirectNotification(string $route, string $type, string $text, array $routeParams = \[\])
- getNotifications()
- clear()

Pagination Helper
-----------------

[](#pagination-helper)

To be able to use Pagination Helper, several changes are required in both the controller and the entity repository. Sample controller function:

```
public function index(Request $request, int $page) {
    return $this->render("modules/News/index.html.twig", [
        "page" => $page,
        "news" => $this->paginationHelper->responseData($request, $this->newsRepository, $page)
    ]);
}

```

As you can see the `responseData` function requires three parameters. One of them is the repository of the entity we are paging. Now we need to make changes in the entity repository - repository class have to extends `Adamski\Symfony\HelpersBundle\Model\PaginableRepository` and implement `getPaginated` function:

```
public function getPaginated(int $page = 1, int $limit = 20) {
    $queryBuilder = $this->getEntityManager()->getRepository("App:News")
        ->createQueryBuilder("news");

    $queryBuilder->where($queryBuilder->expr()->eq("news.public", true))
        ->orderBy("news.createdAt", "DESC");

    return $this->paginate($queryBuilder->getQuery(), $page, $limit);
}

```

Now just add function to render the pagination component in template.

```
{{ pagination(news, "news.index", page) }}

```

PDF Helper
----------

[](#pdf-helper)

PDF Helper offers only one function - `initDocument`. This function create PDFDocument object which provides some useful functions needed to create a PDF document. Below is an example of using PDF Helper:

```
$pdfName = "Sample PDF document";

// Generate PDF template
$documentContent = $this->renderView("pdf/document-content.html.twig", [
    "data" => $data
]);

// Generate PDF document
$pdfDocument = $this->pdfHelper->initDocument();
$pdfDocument->setTitle($pdfName);
$pdfDocument->setAuthor("Author");
$pdfDocument->setCreator("Creatot");
$pdfDocument->setFooter($pdfName);
$pdfDocument->writeHTML($documentContent);

// Generate response
$response = new Response(
    $pdfDocument->output($pdfName)
);

$response->headers->set("Content-Type", "application/pdf");
$response->headers->set("Content-Disposition", "attachment; filename=\"" . $pdfName . ".pdf\"");

return $response;

```

In the example shown, the template file is rendered, and then the HTML code is inserted as the content of the new PDF document. In addition, the parameters of the PDF file are set.

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~18 days

Recently: every ~6 days

Total

10

Last Release

2869d ago

Major Versions

1.1.2 → 2.0.02018-07-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/99031579203ae7aff3a32b3309374cb5703c35abc4737509bc6b228b433d9943?d=identicon)[m-adamski](/maintainers/m-adamski)

---

Top Contributors

[![m-adamski](https://avatars.githubusercontent.com/u/21038303?v=4)](https://github.com/m-adamski "m-adamski (28 commits)")

### Embed Badge

![Health badge](/badges/m-adamski-symfony-helpers-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/m-adamski-symfony-helpers-bundle/health.svg)](https://phpackages.com/packages/m-adamski-symfony-helpers-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M528](/packages/shopware-core)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k16.8k](/packages/prestashop-prestashop)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M717](/packages/sylius-sylius)

PHPackages © 2026

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