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

Finish & output

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

When you're done with setting variables and parsing your blocks, it's time to write the contents to your client. At first, you need to parse() the contents of the file handle into a new handle.

To remove all unused variables and blocks, you might want to call finish(). Depending on the value set for unknowns (as second paramter in the constructor, or via setUnknowns()), unused variables are either erased (remove), kept (keep) or commented out (comment).

To echo your HTML, either directly use the return value of finish(), or use get() to retrieve the content.

Finishing a file and writing it out

<?php
$t
->parse('OUT''authors');
$htmlcode $t->finish(
    
$tpl->get('OUT')
);
echo 
$htmlcode;
?>

Finishing a file and writing it out, the easy way

<?php
echo $tpl->finish($t->parse('OUT''authors'));
?>


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

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