$flexy->outputObject()

$flexy->outputObject() -- コントローラオブジェクトとテンプレートをマージし、結果を出力する

概要

void $flexy-> outputObject (object $controllerObject [, array $elements])

説明

引数に指定されたオブジェクトの変数 (と任意でロードされる HTML_Template_Flexy_Elements) を、テンプレート実行時に有効になるようにセットします。

パラメータ

注意

この関数は、スタティックにコールする ことはできません。

例 40-1テンプレートの準備と出力


<?php
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);
?>

例 40-2テンプレートとタグ

<B>{tag}</B>
<B>{tag:h}</B>
<INPUT name="test">

例 40-3結果の出力

<B>&gt;&gt; hello world</B>
<B>>> hello world</B>
<INPUT name="test" value="hello input">