f0ska / auto-grid-bundle
Automatic grid generation for Symfony Doctrine entities.
Installs: 4
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/f0ska/auto-grid-bundle
Requires
- php: >=8.2.0
- symfony/framework-bundle: >=7
This package is auto-updated.
Last update: 2025-11-09 18:20:32 UTC
README
AutoGrid is a Symfony bundle that automatically generates fully functional grids for your Doctrine entities. It provides columns for each property, along with pagination, filtering, and sorting capabilities. Additionally, it includes basic CRUD functionality. Built-in forms and views for your entity are simple, designed to help you get started quickly. Of course, you can easily provide your own form definitions and templates.
Who is AutoGrid for?
AutoGrid is designed for developers who either do not want or do not have the time to write grids for Doctrine entities. It is ideal for proof-of-concept projects, simple admin interfaces, and more.
How to use AutoGrid?
You don’t need any configuration to get started. Just two lines of code in your controller and one line in your Twig template are all that's required.
Controller Example:
use F0ska\AutoGridBundle\Factory\AutoGridFactory; ... public function myAction(AutoGridFactory $autoGridFactory): Response { $autoGrid = $autoGridFactory->create(MyEntity::class); return $autoGrid->getResponse() ?? $this->render('my-template.html.twig', ['autoGrid' => $autoGrid]); }
Twig Template Example:
{{ agRender(autoGrid) }}
For more advanced usage, refer to the documentation.
Technical notice
AutoGrid is built for Symfony 7+ and PHP 8.2+. It uses the Bootstrap 5 theme and icons to display content nicely.
You will need to adapt AutoGrid templates if your project does not use Bootstrap 5. However, this process is straightforward and much faster than building grids from scratch. Initially, it's recommended to include the Bootstrap theme (even from a CDN) to see how it is supposed to look by default. This will help you customize AutoGrid templates for your specific theme.
Bundle Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
composer require f0ska/auto-grid-bundle
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
composer require f0ska/auto-grid-bundle
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php file of your project:
// config/bundles.php return [ // ... F0ska\AutoGridBundle\F0skaAutoGridBundle::class => ['all' => true], ];