HTML_Template_Flexy学习笔记(一)
概述
Configuration Options -- HTML_Template_Flexy 默认的设置
new HTML_Template_Flexy -- 构造对象
$flexy->compile() -- 把模板(.html)中的flexy标记转化为PHP代码
$flexy->outputObject() -- 将一个controller 对象与它需要的模板在代码级上合并,且输出(output)结果。
$flexy->bufferedOutputObject() -- 将一个controller 对象与它需要的模板在代码级上合并,且返回(return)结果。
$flexy->getElements() -- 从模板中获取Dynamic HTML 元素
new HTML_Template_Flexy_Element -- 类的构造器
$element->setValue() -- 用函数给一个普通的标签类型设置或者存储值。
$element->setOptions() -- Utility function equivilant to HTML_Select - loadArray **
$element->removeAttributes() -- 删除属性
$element->setAttributes() -- 设置HTML属性
$element->toHtml -- Output HTML and children
$element->toHtmlnoClose() -- Output Open Tag and any children and not Child tag (designed for use with <form + hidden elements>
$factory->freeze() -- freeze - freeze's an element. - just copies the value to the override.
$factory->fromArray() -- fromArray - builds a set of elements from a key=>value array (eg. DO->toArray()) the second parameter is an optional HTML_Element array to merge it into.
$factory->fromArrayPrefixed() -- fromArrayPrefixed - takes a multi dimensional array, and builds the 'xxx[sss][xx]' => value
$factory->setErrors() -- setErrors - sets the suffix of an element to a value..
$factory->setRequired() -- setRequired - sets the prefix of an element to a value..
{variable} -- 创建出一段php代码,并且echo出这个变量值。
{method(arguments,#quoted arguments#)} -- 创建一个php函数调用,并且echo出results。
{foreach:variable,key,value} -- 创建一个foreach循环。
{if:variable} -- 创建一个php的if语句块。
{end:} -- 关闭一个if或foreach语句块。
{else:} -- 添加一个php的else块。
<FORM NAME="name" FLEXYOBJECT="name"> -- configures automatic form elements
<INPUT NAME="name"> -- creates PHP variable for input values
<TEXTAREA NAME="name"> -- creates PHP variable for textarea value
<SELECT NAME="name"> -- creates PHP variable and code for select lists
flexy:if="variable or method()" -- creates a PHP if conditional tag
flexy:foreach="variable,key,value" -- creates a PHP foreach loop using a html attribute
FLEXYSTART -- Start the output, using this tag and it's children.
FLEXYSTARTCHILDREN -- Start the output using it's children.
flexy:ignore -- Prevent Automatic form value replacement
搜索更多相关主题的帖子:
Flexy Template 笔记 HTML flexy