PHPCG is designed to easily manage multiple values stored in a single MySQL field.
The array values are stored in your database in standard format (MySQL SET
and ENUM
fields) or JSON format (text fields).
The multiple values can be filtered in the READ list, and modified with either select multiple fields or checkboxes.
PHPCG accepts both native multiple values fields like SET
and ENUM
and Text
fields using multiple values recorded in JSON.
If you use this type of fields, the CRUD Generator:
The possible values are necessarily predefined by the configuration of MySQL fields from your database.
All types of text fields (varchar
, text
, ...) can accept multiple values.
The values will be saved in JSON format in the database. They can then be converted into tables and used as values for multiple select fields or checkboxes.
The accepted values must be defined from the CRUD Generator (see next section).
The array values can:
- either be defined manually one by one (custom values)
- or come from a field in your database (values from the database)
First, open the generator, select your table and validate.
The READ list tab
In the Type dropdown list, select Array (checkbox or select multiple)
The CREATE / UPDATE forms tab
In the Field dropdown list, select Checkbox
or Select
, then click the Add / Edit values
button
custom values
Simply add / edit the values
values from the database
To generate your admin panel with PHPCG you must beforehand:
The CRUD Generator
List views & forms
Filters
Misc