Class: WindView
Source Location: /viewer/WindView.php
Class WindView
Class Overview
Implements interfaces:
视图处理器
WindView是基础的视图处理器,职责:进行视图渲染. 他实现自接口IWindView,该类依赖WindViewerResolver完成视图渲染工作 WindView支持丰富的配置信息,可以通过修改相关配置来改变视图输出行为.template-dir :模板目录,支持命名空间格式:WIND:template,当命名空间为空时以当前app的rootpath为默认命名空间;template-ext :模板后缀,默认为htm,可以通过配置该值来改变模板的后缀名称;is-compile :是否开启模板自动编译,当开启自动编译时程序会根据编译文件是否存在或者是否已经过期来判断是否需要进行重新编译.支持'0'和'1'两种输入,默认值为'0'.compile-dir :模板编译目录,输入规则同'template-dir'.(注意:该目录需要可写权限). 默认配置支持如下: array(
'template-dir' => 'template',
'template-ext' => 'htm',
'is-compile' => '0',
'compile-dir' => 'DATA:template',
'compile-ext' => 'tpl', //模板后缀
'layout' => '', //布局文件
'theme' => '', //主题包位置
'htmlspecialchars' => 'true', //是否开启对输出模板变量进行过滤
)
该类的组件配置格式: 'windView' => array('path' => 'WIND:viewer.WindView',
'scope' => 'prototype', //注意:命名空间为'prototype'
'config' => array(
'template-dir' => 'template',
'template-ext' => 'htm',
'is-compile' => '0',
'compile-dir' => 'compile.template',
'compile-ext' => 'tpl',
'layout' => '',
'theme' => ''),
'properties' => array(
'viewResolver' => array('ref' => 'viewResolver')
))
<note>注意:框架默认视图组件,通过修改组件配置修改默认视图组件.(详细操作参考组件配置定义)</note>
Located in /viewer/WindView.php [line 46]
WindModule
|
--WindView
Author(s):
Information Tags:
Version: | $Id: WindView.php 3269 2011-12-21 06:16:00Z yishuo $ |
Copyright: | ©2003-2103 phpwind.com |
License: | |
|
Properties
|
Methods
|
Inherited Properties, Constants, and Methods
Properties
模板编译文件生成目录,目录定义规则同templateDir
API Tags:
模板编译文件生成后缀,默认值为'tpl'
API Tags:
是否对模板变量进行html字符过滤
API Tags:
是否开启模板自动编译
接受两种输入值0和1 - 0 关闭,不进行模板编译
- 1 进行模板编译
API Tags:
模板目录
支持命名空间格式:WIND:template, 当命名空间为空时以当前app的rootpath为默认命名空间 API Tags:
视图解析引擎,通过组件配置改变该类型
API Tags:
Methods
string getCompileFile(
[string
$template = '']
)
|
|
返回模板的编译文件绝对路径地址
根据模板的逻辑名称,返回模板的绝对路径信息,支持命名空间方式定义模板信息. $template='templateName'; //return $compileDir/templateName.$ext
$template='subTemplateDir.templateName'; //return $compileDir/subTemplateDir_templateName.$ext
$template='namespace:templateName'; //return $compileDir/__external_subDir_templateName.$ext
<note>注意:$template为空则返回当前的模板的路径信息.</note>
Parameters:
string |
$template: |
模板名称, 默认值为空, 为空则返回当前模板的编译文件 |
API Tags:
string getViewTemplate(
[string
$template = ''], [string
$ext = '']
)
|
|
返回模板绝对路径信息
根据模板的逻辑名称,返回模板的绝对路径信息,支持命名空间方式定义模板信息. $template='templateName'; //return $templateDir/templateName.$ext
$template='subTemplateDir.templateName'; //return $templateDir/subTemplateDir/templateName.$ext
$template='namespace:templateName'; //return namespace:templateName.$ext
<note>注意:$template为空则返回当前的模板的路径信息.模板文件后缀名可以通过修改配置进行修改.</note>
Parameters:
string |
$template: |
模板名称, 默认值为空 , 为空则返回当前模板的绝对地址 |
string |
$ext: |
模板后缀, 默认值为空, 为空则返回使用默认的后缀 |
API Tags:
void render(
[
$display = false]
)
|
|
Parameters:
API Tags:
Implementation of:
- IWindView::render()
- 视图渲染方法
void setTheme(
string
$theme
)
|
|
Parameters:
API Tags:
void setThemePackage(
string
$package
)
|
|
设置当前主题包的位置
Parameters:
API Tags:
|
|