Destoon Two-time Development walkthrough Tutorial Destoon is the preferred solution for the open source business-to-business (e-commerce) portal based on Php+mysql. In this paper, the two development of Destoon is summarized as follows: first, the initialization system contains the system root directory common.inc.php can initialize the system. For example, create a hello.php under the site root, with the following code:
- Require ' common.inc.php ';
- Echo ' Hello world ';
- ?>
Copy CodeSecond, after writing the logic system initialization, you can write logic code in the PHP file, but also can call the system built-in variables, functions and classes. Example:
- Require ' common.inc.php ';
- echo dt_root;//physical path to output site
- Echo '
';
- Echo dt_path;//Home address of the output site
- Echo '
';
- $r = $db->get_one ("select * FROM {$DT _pre}category");//Query a data from the table
- Print_r ($r);//print read data
- $A = Cache_read (' area.php ');//Read the system's region cache
- Print_r ($A);//print read data
- Print_r ($MODULE);//print System Module data
- Message (' Hello world ');//output a hint of information
- ?>
Copy CodeThird, the application template all the HTML output to the browser is displayed through the rules in the template. How to use:
- Include template (' A ', ' B ');
Copy CodeThe parameter a indicates that the template name parameter B indicates the directory where the templates are stored, and this parameter can not be set if the template directory is default, then: Template (' A ', ' B '); Represents the template/default/b/a.htm template file (' a '); Representative Template/default/a.htm Template File Example
- Require ' common.inc.php ';
- Template (' Hello ');
- ?>
Copy CodeIn addition, template/default/hello.htm template files need to be created in advance. Recommended reading:Destoon Introductory Tutorials and tips examples |