arkounay / quick-admin-generator-bundle
QAG is a bundle that generates cruds admin for Symfony applications using Doctrine.
Installs: 3 495
Dependents: 0
Suggesters: 0
Security: 0
Stars: 24
Watchers: 5
Forks: 2
Open Issues: 3
Type:symfony-bundle
Requires
- php: >=8.2.0
- arkounay/ux-collection: ^4.0
- doctrine/doctrine-bundle: >=2.1
- doctrine/doctrine-migrations-bundle: ^3.1
- doctrine/orm: ^2.10
- knplabs/knp-paginator-bundle: >=5.3
- symfony/asset: >=6.3
- symfony/console: >=6.3.0
- symfony/expression-language: >=6.3
- symfony/flex: ^2
- symfony/form: >=6.3.0
- symfony/framework-bundle: >=6.3.0
- symfony/intl: >=6.3.0
- symfony/monolog-bundle: >=3.1
- symfony/property-info: >=6.3.0
- symfony/proxy-manager-bridge: >=6.3.0
- symfony/security-bundle: >=6.3
- symfony/stimulus-bundle: ^2.13
- symfony/twig-bundle: >=6.3.0
- symfony/ux-turbo: ^2.0
- symfony/validator: >=6.3
- symfony/yaml: >=6.3.0
- twig/extra-bundle: >=3.3
- twig/intl-extra: >=3.3
- twig/twig: ^2.12|^3.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/browser-kit: >=6.3.0
- symfony/css-selector: >=6.3.0
- symfony/phpunit-bridge: >=5.3
- symfony/webpack-encore-bundle: >=1.14
- dev-master
- v5.x-dev
- 5.4.5
- 5.4.4
- 5.4.3
- 5.4.2
- 5.4.1
- 5.4.0
- 5.3.0
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.0
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- v4.x-dev
- 4.10.1
- 4.10.0
- 4.9.7
- 4.9.6
- 4.9.5
- 4.9.4
- 4.9.3
- 4.9.2
- 4.9.1
- 4.9.0
- 4.8.0
- 4.7.0
- 4.6.1
- 4.6.0
- 4.5.4
- 4.5.3
- 4.5.2
- 4.5.1
- 4.5.0
- 4.4.1
- 4.4.0
- 4.3.0
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- v3.x-dev
- 3.18.3
- 3.18.2
- 3.18.1
- 3.18.0
- 3.17.0
- 3.16.1
- 3.16.0
- 3.15.2
- 3.15.1
- 3.15.0
- 3.14.3
- 3.14.2
- 3.14.1
- 3.14.0
- 3.13.0
- 3.12.0
- 3.11.0
- 3.10.0
- 3.9.3
- 3.9.2
- 3.9.1
- 3.9.0
- 3.8.0
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.3
- 3.6.2
- 3.6.1
- 3.6.0
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- v2.x-dev
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.3.0
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-dev/symfony-7
This package is auto-updated.
Last update: 2024-11-06 13:02:58 UTC
README
QAG is a bundle that allows quick and simple generation of administration backends for Symfony applications using Doctrine.
Getting started
Install the dependency:
composer require arkounay/quick-admin-generator-bundle
also, make sure the following line was added in config/bundles.php
:
Arkounay\Bundle\QuickAdminGeneratorBundle\ArkounayQuickAdminGeneratorBundle::class => ['all' => true],
and that assets were installed: php bin/console assets:install --symlink
.
Finally, add the following route configuration, for example in config/routes.yaml
:
qag_routes: resource: 'Arkounay\Bundle\QuickAdminGeneratorBundle\Crud\RouteLoader' type: service prefix: '/admin'
You will probably want to secure the /admin route prefix. To do so, you can add the following line in your security.yaml
:
access_control: - { path: ^/admin, roles: ROLE_ADMIN }
and that's it, the bundle is ready to be used.
Now, you can add a Controller that extends Arkounay\Bundle\QuickAdminGeneratorBundle\Controller\Crud
to add your first crud.
For example, let's say you have a News
entity.
!> Make sure your entity implements __toString()
!
Create a controller, for instance src/Controller/Admin/NewsController.php
, with the following code:
namespace App\Controller\Admin; use App\Entity\News; use Arkounay\Bundle\QuickAdminGeneratorBundle\Controller\Crud; class NewsController extends Crud { public function getEntity(): string { return News::class; } }
and now refresh /admin
in your browser. You should see a new "News" item that appeared in the menu, and you should now be able to create, edit, and delete news.
If you use the symfony command to display routes php bin/console debug:router
, you'll see that some routes have been generated for you:
qag.category ANY ANY ANY /admin/category/
qag.category_create ANY ANY ANY /admin/category/create
qag.category_delete ANY ANY ANY /admin/category/delete/{id}/
qag.category_delete_batch ANY ANY ANY /admin/category/deleteBatch
qag.category_edit ANY ANY ANY /admin/category/edit/{id}/
qag.category_export ANY ANY ANY /admin/category/export
qag.category_filter_form_ajax ANY ANY ANY /admin/category/filterFormAjax
qag.category_toggle_boolean_post POST ANY ANY /admin/category/toggleBooleanPost/{id}/
Next steps
There are multiple ways to configure and override things in QAG Bundle, depending on the complexity of the project. You can use attributes for simple and quick tweaks regarding entity fields, override Twig templates to change the appearance, add listeners to create special rules that apply when parsing entities, and more.
See :