继承父类配置smarty
来源:互联网 发布:黄静案 知乎 编辑:程序博客网 时间:2024/05/24 05:23
继承父类然后重写其私有属性是不可能的。在不改其源代码的情况下,这就需要使用smarty提供的两个接口函数。
setTemplateDir()和setCompileDir()
配置如下:
class Mysmarty extends Smarty{ publicfunction __construct(){ parent::__construct(); $this->setTemplateDir= './templates'; $this->setCompileDir= './compile'; } }
源码中如下:
private $template_dir = array('./templates/'); private $compile_dir = './templates_c/';public functionsetTemplateDir($template_dir) { $this->template_dir = array(); foreach ((array) $template_dir as $k => $v) { $this->template_dir[$k] = rtrim($v, '/\\') . DS; } $this->joined_template_dir = join(' # ',$this->template_dir); return $this; }public function setCompileDir($compile_dir) { $this->compile_dir = rtrim($compile_dir, '/\\') . DS; if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { Smarty::$_muted_directories[$this->compile_dir] = null; } return $this; }
0 0
- 继承父类配置smarty
- 配置Smarty
- smarty配置
- smarty配置
- Smarty配置
- CI继承smarty方法
- smarty之模板继承
- php Smarty 高级 模板继承
- smarty技术的配置
- smarty 安装与配置
- php smarty的配置
- php之 smarty配置
- 初识smarty简单配置
- smarty的配置
- Smarty安装配置方法
- smarty配置及教程
- Smarty缓存配置
- smarty配置和用法
- NSDcitrionary哈希
- Java简单易懂的生成不重复随机整数数组的方法
- HDU 5463 Clarke and minecraft
- 视频项目的PCB规范
- SQL扩展之T-SQL中的数据操纵语言
- 继承父类配置smarty
- HashSet容器 删除/添加数据实例
- Android0918<二十二>(自定义View的属性,下载显示球)
- 6、K均值算法
- STM32 FSMC 笔记~~~~~~~~~
- 修改系统TabBar上图片和文字的颜色
- Unity3D:图形渲染优化、渲染管线优化、图形性能优化
- 计算机组成原理第一次作业
- 推荐几个好玩又有难度的编程网站