$flexy->outputObject() – Merges a controller object with the template and outputs the result


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


This makes the values of the supplied object (and optionally loads the HTML_Template_Flexy_Elements) available to the template when it is run.


  • object $controllerObject - The object you want to use with the template, the values of the object will relate to the $controllerObject->tag will map to {tag} on the template

  • array $elements - This is an associative array of form, or dynamic elements names (or id's) which will be merged with the one defined in the template.


This function can not be called statically.


PHP code initiating the template, and outputing it

class example {
$tag ">> hello world";

$data = new example;

$elements['test'] = new HTML_Template_Flexy_Element;
$elements['test']->setValue("hello input");

$output = new HTML_Template_Flexy();

The Template with some tags

<INPUT name="test">

Resulting output

<B>&gt;&gt; hello world</B>
<B>>> hello world</B>
<INPUT name="test" value="hello input">
Converts a template from markup to PHP if required (Previous) Merges a controller object with the template and returns the result (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.