复制内容到剪贴板
代码:
$flexy->outputObject()
void $flexy-> outputObject (object $controllerObject [, array $elements])精髓:$controllerObject 的所有成员
变量的值会赋给
template中同名{tag},而数组$elements的所有元素的值将赋予template的
form中同名的元素。
controller class example:
复制内容到剪贴板
代码:
class example {
var $tag = ">> hello world";
}
$data = new example;
$elements['test'] = new HTML_Template_Flexy_Element;
$elements['test']->setValue("hello input");
$output = new HTML_Template_Flexy();
$output->compile("hello.html");
$output->outputObject($data,$elements);template example:
复制内容到剪贴板
代码:
<B>{tag}</B>
<B>{tag:h}</B>
<INPUT name="test">输出结果:
引用:
<B>>> hello world</B>
<B>>> hello world</B>
<INPUT name="test" value="hello input">