Demo of destoon secondary development _ PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.