codecamp

index.php

<?php
/*
* @copyright   Leyun internet Technology(Shanghai)Co.,Ltd
* @license     http://www.dzzoffice.com/licenses/license.txt
* @package     DzzOffice
* @version     DzzOffice 1.1 2014.07.05
* @link        http://www.dzzoffice.com
* @author      zyx(zyx@dzz.cc)
*/
//此页的调用地址  index.php?mod=test;
//同目录的其他php文件调用  index.php?mod=test&op=test1;

if(!defined('IN_DZZ')) { //所有的php文件必须加上此句,防止被外部调用
        exit('Access Denied');
}
require libfile('function/test');//引入函数文件示例,此例将会调用./function/function_test.php,注意函数文件名的命名规则。
require libfile('class/test');//引入类文件示例,此例将会调用./class/class_test.php,注意类文件名的命名规则。

$testid=!empty($_GET['testid'])?intval($_GET['testid']):0;//所有参数使用$_GET获取;
$test=array();
$navtitle=lang('test','title'); //定义模板的title内容;
if($testid) $test=C::t('test')->fetch($testid); //读取一条数据;
/*//如果不在应用内部调用需要改成如下的方式
        $test=C::t('#test#test')->fetch($testid); //#test#为此应用所在的目录
*/
/*如果class/table/table_test.php不存在,也可以使用如下的方法来读取;
        $test=DB::fetch_first("select * from %t where testid = %d ",array('test',$testid));
*/
include template('test');//调用./template/test.htm模板;
/*//调用./template/sub/demo.htm 模板,按下面的方式;
        include template('sub/demo');
/*
test.htm
cron_test.php
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Dzz系统框架

输入数据处理

数据DB层

安全相关

上传组件

评论组件

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }