dmitry-trish / report-bundle
Symfony report bundle
Installs: 34
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/dmitry-trish/report-bundle
Requires
- php: >=5.3.3
This package is not auto-updated.
Last update: 2025-09-30 09:04:06 UTC
README
by Dmitry Trish
Installation
- Add composer package
$ composer require dmitry-trish/report-bundle
- Add
new DmitryTrish\ReportBundle\DmitryTrishReportBundle()
in appKernel.php $bundles array - Update your DB schema
$ ./bin/console doctrine:schema:update --force
Usage
Get report service in your controller or whatever your want.
$service = $this->get('dmitry_trish.report.report_service');
Then create a report form. It's handling request automatically.
$form = $service->createForm();
Register submitted form by call register method.
if ($form->isSubmitted() && $form->isValid()) { $service->register($form->getData()); }
Advanced
You can register report without creating and handling form. Just create new Report instance and provide report text. Then register it.
use DmitryTrish\ReportBundle\Entity\Report; ... $report = new Report(); $report->setText('Some report text'); $service->register($report);