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

Class: WindViewTemplate

Source Location: /viewer/compiler/WindViewTemplate.php

Class WindViewTemplate

Class Overview

模板编译类

职责:进行模板编译,该类接收一个需要编译的模板文件地址,获取该模板内容并进行编译处理然后返回该内容. 组件配置信息,可以通过config标签实现标签扩展支持:

  1.  'template' => array(
  2.  'path' => 'WIND:viewer.compiler.WindViewTemplate',
  3.  'scope' => 'prototype',
  4.  'config' => array('resource' => ''),
  5.  )
  6.  <config>
  7.  //配置信息
  8.  <support-tags>
  9.  <!-- 标签配置:name标签名字, tag:具体的标签, pattern:匹配表达式 ,  compiler:解析类文件-->
  10.  <!--<tag name='' tag='' pattern='' compiler='' /> -->
  11.  </support-tags>
  12.  </config>
扩展名为'test'的标签扩展配置如下,需要定义标签名称,用于匹配该标签的正则表达式(可以为空,为空则调用默认的正则标签匹配,通常情况下请保持为空), 以及用于解析该标签的标签编译器(标签编译器需要继承AbstractWindTemplateCompiler):
  1.  <support-tags>
  2.  <tag name='test' tag='test' pattern='<(test)[^<>\n]*(\/>|>[^<>]*<\/\1>)' compiler='TEST:TestTemplateCompiler' />
  3.  </support-tags>

Located in /viewer/compiler/WindViewTemplate.php [line 35]

WindModule
   |
   --AbstractWindViewTemplate
      |
      --WindViewTemplate
Author(s): Information Tags:
Version:  $Id: WindViewTemplate.php 3330 2012-01-15 13:49:24Z yishuo $
Copyright:  ©2003-2103 phpwind.com
License:  http://www.windframework.com

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 AbstractWindViewTemplate

AbstractWindViewTemplate::compile()
进行视图渲染
AbstractWindViewTemplate::compileDelimiter()
AbstractWindViewTemplate::compileStream()
渲染流
AbstractWindViewTemplate::doCompile()
模板内容编译实现,返回编译后模板内容内容

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
array   $compiledBlockData   match后的模块文件块
WindHandlerInterceptorChain   $windHandlerInterceptorChain  
mixed   $_compilerCache  

[ Top ]
Method Summary
void   doCompile()  
string|array   getCompiledBlockData()   返回编译后结果,根据Key值检索编译后结果,并返回.当key值为空时返回全部数据
string   getCompiledBlockKey()   获得切分后块编译缓存Key值,Key值为一个50位的随机字符串,当产生重复串时继续查找
array   getTags()   返回当前解析器中所有注册进来的标签集合
void   setCompiledBlockData()   根据key值保存编译后的模板块

[ Top ]
Properties
array   $compiledBlockData = array() [line 41]

match后的模块文件块

API Tags:
Access:  protected


[ Top ]
WindHandlerInterceptorChain   $windHandlerInterceptorChain = null [line 45]
API Tags:
Access:  protected


[ Top ]
mixed   $_compilerCache = array() [line 46]
API Tags:
Access:  protected


[ Top ]
Methods
doCompile  [line 51]

  void doCompile( $content, [ $windViewerResolver = null]  )

Parameters:
   $content: 
   $windViewerResolver: 

API Tags:
Access:  protected


Redefinition of:
AbstractWindViewTemplate::doCompile()
模板内容编译实现,返回编译后模板内容内容

[ Top ]
getCompiledBlockData  [line 198]

  string|array getCompiledBlockData( [string $key = '']  )

返回编译后结果,根据Key值检索编译后结果,并返回.当key值为空时返回全部数据

Parameters:
string   $key: 

API Tags:
Access:  public


[ Top ]
getCompiledBlockKey  [line 184]

  string getCompiledBlockKey( )

获得切分后块编译缓存Key值,Key值为一个50位的随机字符串,当产生重复串时继续查找


API Tags:
Access:  protected


[ Top ]
getTags  [line 116]

  array getTags( )

返回当前解析器中所有注册进来的标签集合


API Tags:
Access:  protected


[ Top ]
setCompiledBlockData  [line 212]

  void setCompiledBlockData( string $key, string $compiledBlockData  )

根据key值保存编译后的模板块

Parameters:
string   $key:  索引
string   $compiledBlockData:  编译结果

API Tags:
Access:  public


[ Top ]

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