Generate your Bootstrap Admin list view in a few clicks with PHPCG
The "List views" are the lists of records displayed in tabular form in the admin dashboard.
The CRUD Generator allows you to integrate each table of your database into the admin dashboard. It detects the different types of fields and provides you with the appropriate parameters according to them.
Creating a list view is straightforward, and the form contains the necessary help and tooltips to guide you, however we will detail the available functionality here.
The list view creation form is organised into five parts, allowing you to customise your list view to suit your needs.
You can validate at the bottom of the page to generate the admin's list view.
You can also regenerate your lists at any time, which makes your admin panel infinitely scalable.
If you have customised the code generated by the CRUD, the compare/merge tool allows you to carry over the changes made in the previous version to the newly generated version.
Let's see more closely how this form is organised.
Here you can configure the following settings:
Define here for each field the readable names that will be displayed in the admin. For example "Last name" for a "last_name" field.
The names defined here will be used everywhere they are to appear in the admin: in the List view, but also in forms, or when these fields are used by other tables in relationships.
Filters allow the user to search and filter the records in the list according to the selected values.
They are interdependent: each filter only shows in its drop-down list the records available with the other filters active.
For filters in "advanced" mode you have to enter the details of the SQL query. A quick help is available right on the generator page; full explanations are available in the filter tutorial.
In this section you can set up each field individually, e.g. whether to display it in the list or not, whether to enable sorting or live editing.
The nested table option removes the fields from the main data table cells, which allows to focus the essential information. A button is added to the beginning of each row of the table, when clicked the nested fields are displayed, providing the details of the record.
The fields types are detected, and the appropriate settings are displayed according to them. E.g. if your field is a date/datetime you'll be prompted to set your preferred date/time display format.
If your field Type is SET/ENUM, or if you activate live editing in "select" mode, you will be offered to choose/edit the values of the "select" field.
These values can be selected from a field in the database, or entered individually.
If a field is a key whose value comes from a relational table, you can choose the value(s) to display from the destination table.
For example, if an address table has a country_id field, you can display the name of the country rather than its ID (which is probably a good idea!)
External relationships are those that use an intermediate table to link two others.
actor => film_actor => film
Although in this kind of relationship the tables are mostly linked by numerical identifiers, PHP CRUD Generator allows you to display the fields of your choice for the destination table.
For instance, you can display the title of the films and their release date rather than their ID (which is quite better!). You just have to choose the fields to be displayed in the "select" multiple field.
To generate your Bootstrap admin panel with PHPCG you must beforehand:
The CRUD Generator
List views & forms