include/control.class.php

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php   if(!defined('DEDEINC')) exit("Request Error!");
/**
 * 织梦控制器基类
 *
 * @version        $Id: control.class.php 1 10:33 2010年7月6日Z tianya $
 * @package        DedeCMS.Libraries
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once(DEDEINC."/dedetemplate.class.php");

class Control
{
    var $tpl;
    var $dsql;
    var $style='default';
    var $_helpers = array();
    
    var $apptpl = '../templates/';
    
    function __construct()
    {
        $this->Control();
    }
    
    // 析构函数
    function Control()
    {
        global $dsql;
        $this->tpl = isset($this->tpl)? $this->tpl : new DedeTemplate();
        $sqltype = "DedeSql";
        if ($GLOBALS['cfg_mysql_type'] == 'mysqli' && function_exists("mysqli_init")) $sqltype = "DedeSql";
        else $sqltype = "DedeSqli";
        $this->dsql = isset($dsql)? $dsql : new $sqltype(FALSE);
    }
    
    //设置模板
    //如果想要使用模板中指定的pagesize,必须在调用模板后才调用 SetSource($sql)
    function SetTemplate($tplfile)
    {
        $tplfile = DEDEAPPTPL.'/'.$this->style.'/'.$tplfile;
        $this->tpl->LoadTemplate($tplfile);
    }
    function SetTemplet($tplfile)
    {
        $tplfile = DEDEAPPTPL.'/'.$this->style.'/'.$tplfile;
        $this->tpl->LoadTemplate($tplfile);
    }
    
    //设置/获取文档相关的各种变量
    function SetVar($k, $v)
    {
        $this->tpl->Assign($k, $v);
    }

    function GetVar($k)
    {
        global $_vars;
        return isset($_vars[$k]) ? $_vars[$k] : '';
后面还有 74 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。