Destoon secondary development getting started instance tutorial

Source: Internet
Author: User
Destoon secondary development getting started instance tutorial

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:

  1. Require 'common. inc. php ';
  2. Echo 'hello world ';
  3. ?>

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:

  1. Require 'common. inc. php ';
  2. Echo DT_ROOT; // physical path of the output site
  3. Echo'
    ';
  4. Echo DT_PATH; // the home address of the output site
  5. Echo'
    ';
  6. $ R = $ db-> get_one ("SELECT * FROM {$ DT_PRE} category"); // query a data entry FROM the category table
  7. Print_r ($ r); // Print the read data
  8. $ A = cache_read ('area. php'); // read the regional cache of the system.
  9. Print_r ($ A); // Print the read data
  10. Print_r ($ MODULE); // Print System MODULE data
  11. Message ('Hello World'); // output a message
  12. ?>

3. the HTML output from the application template to the browser is displayed by the rules in the template. Usage:

  1. 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

  1. Require 'common. inc. php ';
  2. Template ('Hello ');
  3. ?>

In addition, the template/default/hello.htm template file must be created in advance.

Recommended: destoon getting started tutorials and tips

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.