Destoon secondary development example. Destoon is the preferred solution for open-source B2B (e-commerce) industry portal based on PHP + MySQL. This article briefly describes the secondary development of Destoon: 1. the initialization system contains the preferred solution for the open-source B2B (e-commerce) industry portal of Destoon based on PHP + MySQL under the system root directory. This article briefly describes the secondary development of Destoon as follows:
I. initialize the system
The system can be initialized using common. inc. php in the root directory of the system.
For example, to create a hello. php file under the root directory of the site, the code is as follows:
<?phprequire 'common.inc.php';echo 'Hello World';?>
II. write logic
After the system is initialized, you can write logic code in the PHP file and call the built-in variables, functions, and classes of the system.
The sample code is as follows:
<? Phprequire 'common. inc. php'; echo DT_ROOT; // The physical path of the output site echo'
'; Echo DT_PATH; // the home address of the output site echo'
'; $ R = $ db-> get_one ("SELECT * FROM {$ DT_PRE} category"); // query a piece of data print_r ($ r) FROM the category table ); // Print the read data $ A = cache_read ('area. php '); // read the system's regional cache print_r ($ A); // Print the read data print_r ($ MODULE ); // Print the system module data message ('Hello World'); // output a message?>
3. Application Template
All HTML output to the browser is displayed through the rules in the template.
Usage:
include template('a', 'b');
Parameter a indicates the template name.
Parameter B indicates the directory where the template is stored. this parameter can be left unspecified.
If the template directory is default, then:
Template ('A', 'B'); represents the template/default/B/a.htm template file
Template ('A'); represents the template/default/a.htm template file
The sample code is as follows:
<?phprequire 'common.inc.php';template('hello');?>
In addition, the template/default/hello.htm template file must be created in advance.
The preferred solution for e-commerce industry portals. This article describes the secondary development of Destoon as follows: 1. the initialization system contains...