Generate Bootstrap admin list view

Generate your Bootstrap Admin list view in a few clicks with PHPCG


Generating the Admin Dashboard List views

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.

Main settings

Here you can configure the following settings:

Open URL button
This option allows you to link each record to the associated page on your public website.
It' s all explained in detail in this tutorial.
"Export" button (xls / csv)
If enabled, an "Export" button with a dropdown menu will be available in the admin List view.
Users can choose to export all records or only those displayed on the current page.
Export in Excel or CSV format is available, as well as a printable view in a new tab.
Allow bulk delete
This option allows you to delete multiple records at once, by selecting them individually with a checkbox and then confirming the selection.
If your table has relationships with other tables, you will have the option of deleting "cascading" records or not.
Default field for search
The search bar allows the user to choose the database field in which to perform the search by means of a drop-down menu.
This option allows the user to choose which field will be default selected.
Order by
Choose here the default display order of the records.

Field names displayed in admin

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 (dropdown lists to filter results)

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 relations

External relationships are those that use an intermediate table to link two others.
For example 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:

PHP CRUD tutorial main page