When the MySQL column name is not appropriate for display as the title of the column in the displayed table, alternate text can be specified. To display the word "Subject" instead of the name "Topic" for the example column from previous chapter, add the following option to the script:
When creating MySQL tables for use with phpMyEdit, consider using the underscore character in certain field names. For example, a MySQL column named "last_name" will be displayed as "Last name" in tables created using phpMyEdit (underscore characters are replaced with a space).
Sometimes a short title can't be explicit enough, so it is neccessary to provide the user a large description on a given field when he is manipulating with field data. For this purpose was
$opts['fdd']['col_name']['help'] option created. Content of this option will appear in the third column of record display pages (Add, View, Change, Copy and Delete modes).
This option is optional. If there is no
['help'] option for all columns, the third "help" column will be omitted.
Example 4-4. Field guidance hyperlink
$opts['fdd']['topic']['help'] = '<a href="help.php?about=topic" target="_blank">?</a>';
Specify field input type as text box, numeric comparison text box, drop-down selection, or multiple selection. The same input type will be used also for table filtering.
Example 4-5. Filter selections
$opts['fdd']['col_name']['select'] = 'T'; // text box $opts['fdd']['col_name']['select'] = 'N'; // numeric $opts['fdd']['col_name']['select'] = 'D'; // drop down $opts['fdd']['col_name']['select'] = 'M'; // multiple selection $opts['fdd']['col_name']['select'] = 'O'; // radio buttons $opts['fdd']['col_name']['select'] = 'C'; // checkboxes
An optional parameter to control whether a field is displayed in the add, change, copy, delete, view, list, or filter views.
||-- table list|
||-- table filter|
Example 4-6. Field display options
$opts['fdd']['col_name']['options'] = 'LF'; // shows only in table list/filter
There are also additional column-specific options. These apply to certain views or modes (add, change, delete, list). In the previous versions of phpMyEdit these flags was part of
['options'] option. In the current 5.7.1 version, the backward compatibility (BC) is preserved. However this will be removed in the future. Thus specify these flags as a part of
['input'] options. Some other flags may be added into this option as well.
||-- indicates a field is read only|
||-- indicates a field is a password field|
||-- indicates a field is to be hidden and marked as hidden|
Example 4-7. Other display options
$opts['fdd']['col_name']['input'] = 'H'; // hidden field $opts['fdd']['col_name']['input'] = 'P'; // password field $opts['fdd']['col_name']['input'] = 'R'; // read-only field
Per field, you can define field CSS class names postfix. This is especially useful in order to highlight one column in a table.
Example 4-8. Field CSS customization
$opts['fdd']['col_name']['css'] = array( 'postfix' => 'ColName' );
More information about CSS handling can be found in the CSS classes policy section.
Bootstrap phpMyEdit PHP Form Generator