Home > php教程 > php手册 > body text

destoon二次开发入门示例

WBOY
Release: 2016-06-06 20:21:19
Original
1302 people have browsed it

这篇文章主要介绍了destoon二次开发,需要的朋友可以参考下

Destoon基于PHP+MySQL的开源B2B(电子商务)行业门户的首选解决方案。本文就Destoon的二次开发简述如下:

一、初始化系统

包含系统根目录下的common.inc.php即可初始化系统。

例如在站点根目录下创建一个hello.php,代码如下:

二、编写逻辑

系统初始化之后,就可以在php文件里编写逻辑代码,,同时也可以调用系统内置的变量、函数和类了。

示例代码如下:

'; echo DT_PATH;//输出站点的首页地址 echo '
'; $r = $db->get_one("SELECT * FROM {$DT_PRE}category");//从分类表里查询一条数据 print_r($r);//打印读取的数据 $A = cache_read('area.php');//读取系统的地区缓存 print_r($A);//打印读取的数据 print_r($MODULE);//打印系统模块数据 message('Hello World');//输出一段提示信息 ?>

三、应用模板

所有输出给浏览器的HTML均通过模板里的规则显示。

使用方法:

include template('a', 'b');

参数a表示模版名称
参数b表示模板存放的目录,此参数可以不设置

假如模板目录为default,那么:

template('a', 'b'); 代表 template/default/b/a.htm 模板文件
template('a'); 代表 template/default/a.htm 模板文件

示例代码如下:

此外,template/default/hello.htm 模板文件需要提前创建

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!