zoukankan      html  css  js  c++  java
  • testlink于smarty配置和使用

          于testlink于,采用smarty首先配置。

          一般在过程化的编程中。创建一个smarty.inc.php的文件来配置Smarty的信息,其它文件引入就可以,目的是为了不改动smarty.class.php文件而能够改动smarty的配置。可是这样的方法维护起来比較困难。最佳的方法是使用适配器模式来又一次构建Smarty
          能够创建一个自己的mysmarty.class.php文件,直接继承Smarty.class.php文件就能够了,然后通过构造方法来又一次配置Smarty。这样保证了Smarty类的封装性

          testlink项目中。创建了一个tlsmarty.inc.php文件,继承了Smarty.class.php,在tlsmarty.inc.php文件中对smarty进行配置。

    class TLSmarty extends Smarty
    {
       ...................
    }

          testlink中,将类似    tlsmarty.inc.php 这样封装各个类的文件 引入到 common.php里。然后在处理数据的php里require_once("common.php"); 就能够直接使用这些类以及方法,同一时候,common.php中还有链接数据库和初始化数据的功能。所以基本上我认为阅读testlink代码时,最重要的就是这个common.php文件。



    版权声明:本文博主原创文章。博客,未经同意不得转载。

  • 相关阅读:
    #define #undef
    ps
    Find–atime –ctime –mtime的用法与区别总结
    redis
    linux mutex
    private继承
    boost::noncopyable介绍
    Makefile 中:= ?= += =的区别
    linux Tar 命令参数详解
    Ubuntu14.04安装CMake3.0.2
  • 原文地址:https://www.cnblogs.com/lcchuguo/p/4914314.html
Copyright © 2011-2022 走看看