How to customize the Bootstrap Admin forms?

The Bootstrap Admin Forms can be customized in editing the PHP Form Builder forms in the admin/inc/forms/ folder.


How to edit the Bootstrap Admin Forms?
(About PHP Form Builder)

PHP Form Builder is included in PHP CRUD Generator's package.
With all its functionnalities and plugins.

This means that you can edit the Admin forms with all the PHP Form Builder's functions and features.

The full documentation, sample codes, templates and tutorials are available on PHP Form Builder's website.

PHP Form Builder
PHP Form Builder

All the Admin forms are located in the same folder in admin/inc/forms/.

Each table uses 3 forms:

  • table-create.php
  • table-edit.php
  • table-delete.php

where "table" is the sanitized name of your table.

All the actions (database recordings) are done in the same files after validation.

You can easily edit these files to customize according to your needs: send email, add form plugins, ...


To customize the form fields or the values after POST

  1. Open the PHP form file in admin/inc/forms/ in your code editor
  2. Use the PHP Form Builder function as explained above.

To add custom Javascript to the form:

  1. Create a Javascript file in admin/inc/forms/ with the same item name as in the form file.
    Warning: The item name is not always the table name: dashes and underscores in table names are removed.
    For instance: a table named "my-table" will be admin/inc/forms/mytable.js
  2. The JS file will be automatically loaded with the create/edit/delete forms.

About Tinymce (Rich Text Editor)

Tinymce's Javascript configuration is available in class/phpformbuilder/plugins-config-custom/tinymce.xml

If you installed PHPCG in a subfolder of your project, or if you use the Responsive File Manager you'll have to edit Tinymce's configuration accordingly to your settings:

  • Edit the base_url
  • configure class/phpformbuilder/plugins/filemanager/config/config.php

Prerequisites

To edit the Bootstrap Admin Forms you must beforehand:

PHP CRUD tutorial main page