本帖最后由 cnbsd 于 2012-05-04 16:03:04 编辑

解决方案 »

  1.   

    smarty 对象为初始化。关键的部分没贴出来。
      

  2.   


    已经贴了啊,没贴的smarty类文件Smarty.class.php是下载的!
      

  3.   

    createTemplate() 函数在哪定义的
      

  4.   

    不知道你是如何使用的
    abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data
    这是一的抽象类,没有定义 createTemplate() 方法你必须在继承类中自行定义,或许已在 Smarty_Internal_Data 中定义过了也未可知
    不过既然是 member function createTemplate() on a non-object 显然是继承类没有实例化或者是对象被关在外边了
      

  5.   

    说不定 smarty包 缺少文件呢
      

  6.   


    没有引用正确,按照楼主的目录结构:
      |--Smarty.class.php
      |--system
           |--system.inc.php
           |--system.smarty.inc.phpsystem.smarty.inc.php文件中:
    require '../Smarty.class.php';
      

  7.   


    这么引用会报错
    Warning: require(../Smarty.class.php) [function.require]: failed to open stream: No such file or directory in
      

  8.   

    再试试:require (dirname(__FILE__)."/../Smarty.class.php");
      

  9.   


    public function __construct() {
        parent::__construct();
        $this->template_dir = 'templates/';
        $this->compile_dir = 'templates_c/';
        $this->config_dir = 'configs/';
        $this->cache_dir = 'cache/';
    }
      

  10.   


    眼神果然犀利 , 一眼就看出继承了 Smarty , 并且自己使用了 __construct 那么 smarty 的构造方法就不会运行 , 所以 parent::__construct 才是正解 .
    斑猪们不行啊 .