Destoon secondary development getting started instance tutorial Destoon is the preferred solution for open-source B2B (e-commerce) industry portal based on PHP + MySQL. This article describes the secondary development of Destoon as follows: 1. initialize the system by including common. inc. php under the root directory of the system to initialize the system. For example, to create a hello. php file under the root directory of the site, the code is as follows:
- Require 'common. inc. php ';
- Echo 'hello world ';
- ?>
2. after the logic system is initialized, you can write the logic code in the PHP file and call the built-in variables, functions, and classes of the system. Example:
- Require 'common. inc. php ';
- Echo DT_ROOT; // 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 data entry FROM the category table
- Print_r ($ r); // Print the read data
- $ A = cache_read ('area. php'); // read the regional cache of the system.
- Print_r ($ A); // Print the read data
- Print_r ($ MODULE); // Print System MODULE data
- Message ('Hello World'); // output a message
- ?>
3. the HTML output from the application template to the browser is displayed by 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. if the template directory is default, set this parameter to template ('A', 'B '); template/default/B/a.htm template file template ('A'); template/default/a.htm template file example
- Require 'common. inc. php ';
- Template ('Hello ');
- ?>
In addition, the template/default/hello.htm template file must be created in advance. Recommended: destoon getting started tutorials and tips |