phpDocumentor viewer
[ class tree: viewer ] [ index: viewer ] [ all elements ]

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'.(注意:该目录需要可写权限). 默认配置支持如下:

  1.  array(
  2.  'template-dir' => 'template',
  3.  'template-ext' => 'htm',
  4.  'is-compile' => '0',
  5.  'compile-dir' => 'DATA:template',
  6.  'compile-ext' => 'tpl'//模板后缀
  7.  'layout' => ''//布局文件
  8.  'theme' => ''//主题包位置
  9.  'htmlspecialchars' => 'true'//是否开启对输出模板变量进行过滤
  10.  )
该类的组件配置格式:
  1.  'windView' => array('path' => 'WIND:viewer.WindView',
  2.  'scope' => 'prototype',    //注意:命名空间为'prototype'
  3.  'config' => array(
  4.  'template-dir' => 'template',
  5.  'template-ext' => 'htm',
  6.  'is-compile' => '0',
  7.  'compile-dir' => 'compile.template',
  8.  'compile-ext' => 'tpl',
  9.  'layout' => '',
  10.  'theme' => ''),
  11.  'properties' => array(
  12.  'viewResolver' => array('ref' => 'viewResolver')
  13.  ))
<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

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From WindModule

WindModule::$_config
WindModule::$_proxy
WindModule::$_typeValidation

Inherited From WindModule

WindModule::getConfig()
根据配置名取得相应的配置
WindModule::getRequest()
返回当前应用的WindHttpRequest对象
WindModule::getResponse()
返回当前应用的WindHttpResponse对象
WindModule::getSystemFactory()
返回当前应用的WindFactory对象
WindModule::setConfig()
设置类配置
WindModule::setDelayAttributes()
设置延迟加载类属性相关组件配置信息
WindModule::toArray()
返回该对象的数组类型
WindModule::writeTableCloneProperty()
类对象clone白名单
WindModule::__call()
重载了魔术方法__call
WindModule::__clone()
重载魔术方法__clone
WindModule::__get()
重载了魔术方法__get
WindModule::__set()
重载了魔术方法__set

[ Top ]
Property Summary
string   $compileDir   模板编译文件生成目录,目录定义规则同templateDir
string   $compileExt   模板编译文件生成后缀,默认值为'tpl'
boolean   $htmlspecialchars   是否对模板变量进行html字符过滤
int   $isCompile   是否开启模板自动编译
string   $layout   模板布局文件
string   $templateDir   模板目录
string   $templateExt   模板文件的扩展名
string   $templateName   模板名称
string   $theme   主题包目录
WindViewerResolver   $viewResolver   视图解析引擎,通过组件配置改变该类型
WindLayout   $windLayout   视图布局管理器

[ Top ]
Method Summary
string   getCompileFile()   返回模板的编译文件绝对路径地址
string   getViewTemplate()   返回模板绝对路径信息
void   render()  
void   setConfig()  
void   setTheme()  
void   setThemePackage()   设置当前主题包的位置

[ Top ]
Properties
string   $compileDir [line 87]

模板编译文件生成目录,目录定义规则同templateDir

API Tags:
Access:  public


[ Top ]
string   $compileExt = 'tpl' [line 93]

模板编译文件生成后缀,默认值为'tpl'

API Tags:
Access:  public


[ Top ]
boolean   $htmlspecialchars = true [line 72]

是否对模板变量进行html字符过滤

API Tags:
Access:  public


[ Top ]
int   $isCompile = 0 [line 81]

是否开启模板自动编译

接受两种输入值0和1

  1. 0 关闭,不进行模板编译
  2. 1 进行模板编译

API Tags:
Access:  public


[ Top ]
string   $layout [line 99]

模板布局文件

API Tags:
Access:  public


[ Top ]
string   $templateDir [line 54]

模板目录

支持命名空间格式:WIND:template, 当命名空间为空时以当前approotpath为默认命名空间

API Tags:
Access:  public


[ Top ]
string   $templateExt [line 60]

模板文件的扩展名

API Tags:
Access:  public


[ Top ]
string   $templateName [line 66]

模板名称

API Tags:
Access:  public


[ Top ]
string   $theme = array('theme' => '', 'package' => '') [line 105]

主题包目录

API Tags:
Access:  protected


[ Top ]
WindViewerResolver   $viewResolver = null [line 111]

视图解析引擎,通过组件配置改变该类型

API Tags:
Access:  protected


[ Top ]
WindLayout   $windLayout = null [line 117]

视图布局管理器

API Tags:
Access:  protected


[ Top ]
Methods
getCompileFile  [line 197]

  string getCompileFile( [string $template = '']  )

返回模板的编译文件绝对路径地址

根据模板的逻辑名称,返回模板的绝对路径信息,支持命名空间方式定义模板信息.

  1.  $template='templateName'//return $compileDir/templateName.$ext
  2.  $template='subTemplateDir.templateName'//return $compileDir/subTemplateDir_templateName.$ext
  3.  $template='namespace:templateName'//return $compileDir/__external_subDir_templateName.$ext
<note>注意:$template为空则返回当前的模板的路径信息.</note>

Parameters:
string   $template:  模板名称, 默认值为空, 为空则返回当前模板的编译文件

API Tags:
Access:  public


[ Top ]
getViewTemplate  [line 173]

  string getViewTemplate( [string $template = ''], [string $ext = '']  )

返回模板绝对路径信息

根据模板的逻辑名称,返回模板的绝对路径信息,支持命名空间方式定义模板信息.

  1.  $template='templateName'//return $templateDir/templateName.$ext
  2.  $template='subTemplateDir.templateName'//return $templateDir/subTemplateDir/templateName.$ext
  3.  $template='namespace:templateName'//return namespace:templateName.$ext
<note>注意:$template为空则返回当前的模板的路径信息.模板文件后缀名可以通过修改配置进行修改.</note>

Parameters:
string   $template:  模板名称, 默认值为空 , 为空则返回当前模板的绝对地址
string   $ext:  模板后缀, 默认值为空, 为空则返回使用默认的后缀

API Tags:
Access:  public


[ Top ]
render  [line 122]

  void render( [ $display = false]  )

Parameters:
   $display: 

API Tags:
Access:  public


Implementation of:
IWindView::render()
视图渲染方法

[ Top ]
setConfig  [line 147]

  void setConfig( $config  )

Parameters:
   $config: 

API Tags:
Access:  public


Redefinition of:
WindModule::setConfig()
设置类配置

[ Top ]
setTheme  [line 227]

  void setTheme( string $theme  )

Parameters:
string   $theme: 

API Tags:
Access:  public


[ Top ]
setThemePackage  [line 220]

  void setThemePackage( string $package  )

设置当前主题包的位置

Parameters:
string   $package: 

API Tags:
Access:  public


[ Top ]

Documentation generated on Fri, 30 Mar 2012 11:43:43 +0800 by phpDocumentor 1.4.4