文字

The Yaf_View_Interface class

(Yaf >=1.0.0)

简介

Yaf给用户提供一个了一个可扩展的、可自定的视图引擎接口,用户可以使用自己的视图引擎来代替Yaf内置的Yaf_View_Simple。下面是一个关于怎么实现的例子,请看 Yaf_Dispatcher::setView()

类摘要

Yaf_View_Interface {
abstract public bool assign ( string $name [, string $value ] )
abstract public bool display ( string $tpl [, array $tpl_vars ] )
abstract public void getScriptPath ( void )
abstract public string render ( string $tpl [, array $tpl_vars ] )
abstract public void setScriptPath ( string $template_dir )
}

Table of Contents

  • Yaf_View_Interface::assign — 为视图引擎分配一个模板变量
  • Yaf_View_Interface::display — 渲染一个视图模板, 并直接输出给请求端
  • Yaf_View_Interface::getScriptPath — The getScriptPath purpose
  • Yaf_View_Interface::render — 渲染一个视图模板
  • Yaf_View_Interface::setScriptPath — The setScriptPath purpose
上一篇: 下一篇: