PHP Generator 12.8.0.15 released
Feb 21, 2014
Prev | Next |
SQL Maestro Group is happy to announce the next minor update of PHP Generator 12.8.0.15, a GUI frontend that allows you to generate high-quality PHP scripts for the selected tables, views and queries for the further working with these objects through the web. There are versions for MySQL, MS SQL Server, PostgreSQL, Oracle, SQLite, Firebird, DB2, SQL Anywhere and MaxDB. |
Please find below a detailed description of the most interesting features added in this version. Other new features, corrections, and fixes can be found in the Changelog.
- A new implementation of HTTP tunneling based on MySQLi PHP extension has been added. The installation folder now contains two connection scripts: mysqli_tunnel.php and mysql_tunnel.php. We would recommend you to use the mysqli_tunnel.php script always if possible as it operates through the modern MySQLi PHP extension (available since PHP 5) while mysql_tunnel.php uses the original MySQL PHP API that is deprecated as of PHP 5.5.
-
The algorithm of initialization of View and Edit properties for pages based on queries has been significantly improved to reduce the amount of hand-work required to set up full-featured pages.
- If a query contains a column defined as NOT NULL in the corresponding base table, the Required option is turned ON automatically.
-
If a query contains a column of the ENUM data type, PHP Generator automatically sets up its editor type to ComboBox and fills in that control with the values of the enumeration. The same is applied to the SET data type (for such columns PHP Generator sets up a Group Box editor).
- If a query contains a column that has a foreign key constraint in the corresponding base table, the lookup options are set automatically if the Setup lookups by foreign keys option is turned ON in the program settings.
- Starting from this version PHP Generator tries to detect key columns for queries by itself by the following rule: all the columns included into primary key constraints in their base tables are marked as keys. Of course the list of key columns can be later arranged manually.
-
The visible ([true|false]) method has been added to the editor's API.
Example
Consider we are going to organize a party. To get the right amount of beverages to buy for the party, we have to register all members on the Party webpage, and select the beverage they want to drink and specify the necessary amount of beverage for members who will participate in the party. The user interface might look as follows:
So we need to show or hide the list of beverages and their amount depending on the checkbox state. To accomplish this, you can write the following code:
Listing 1. OnInsertFormLoaded event handler// will not participate by default editors['beverage_id'].visible(false); editors['amount'].visible(false);
Listing 2. OnEditFormLoaded event handlereditors['beverage_id'].visible(editors['will_participate'].getValue()); editors['amount'].visible(editors['will_participate'].getValue());
Listing 3. OnInsertFormEditorValueChanged and OnEditFormEditorValueChanged event handlerif (sender.getFieldName() == 'will_participate') { editors['beverage_id'].visible(sender.getValue()); editors['amount'].visible(sender.getValue()); }
Please be aware that values of hidden controls are sent to the web server on form submission (while values of disabled controls are not). So if you want to hide a control and prevent its value from sending to the web server, you should change the code above as follows:
Listing 4. OnInsertFormLoaded event handlereditors['beverage_id'].enabled(false); editors['amount'].enabled(false); editors['beverage_id'].visible(false); editors['amount'].visible(false);
Other handlers should be changed in the same manner. To retrieve current state of the control, call the method without parameters.
-
Less compiler errors (if any) are now dispalyed in the Preview window after theme customization. On the screenshot below we missed a semicolon after #000 and got the corresponding compiler error.
- The documentation related to events has been significantly updated. Each event is now described in a separate topic and equipped with illustrative examples.
For more information about a specific tool see the appropriate page:>
PHP Generator for MySQL | PostgreSQL PHP Generator | ||
MS SQL PHP Generator | Oracle PHP Generator | ||
Firebird PHP Generator | SQLite PHP Generator | ||
DB2 PHP Generator | MaxDB PHP Generator | ||
ASA PHP Generator |
Prev | Next |