Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 20458 программистов и 981 робот. Сейчас ищут 816 программистов ...

$flexy->outputObject()

Вернуться к: HTML_Template_Flexy

$flexy->outputObject()

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

Synopsis

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.

Parameter

  • 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.

Note

This function can not be called statically.

Example

PHP code initiating the template, and outputing it

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

The Template with some tags

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

Resulting output

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


Вернуться к: HTML_Template_Flexy

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware