powered by simpleCommunicator - 2.0.51     © 2025 Programmizd 02
Форумы / PHP, Perl, Python [игнор отключен] [закрыт для гостей] / Темплет в темплете???
1 сообщений из 1, страница 1 из 1
Темплет в темплете???
    #32449373
maxi11
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Почему не получается вставить темплет в темплет?
main.tpl.htm
<html>
<table border>

<tr>
<!-- BEGIN row --><td>
{DATA}
</td><!-- END row -->
</tr>

</table>
</html>

main1.tpl.htm
<html>

<!-- BEGIN cell1 --> <table border bordercolor="#FFFF00" bgcolor="#00FFFF" width="100%" height="62">
<tr>

<td>
{DATA1}
</td>

</tr>
</table><!-- END cell1 -->
</html>

index.php
<?php
require_once "IT.php";
$tpl = new HTML_Template_IT("templates");
$tpl1 = new HTML_Template_IT("templates");
$tpl->loadTemplatefile("main.tpl.htm", true, true);
$tpl1->loadTemplatefile("main1.tpl.htm", true, true);
$cel="Hello World";
$tpl->setCurrentBlock("row");
$tpl->setVariable("DATA", $cel);
$tpl->parseCurrentBlock("row");
$tpl1->setCurrentBlock("cell1");
$t=$tpl->show();
$tpl1->setVariable("DATA1", $t);
$tpl1->parseCurrentBlock("cell1");
$tpl1->show();
?>

В результате работы в броузер выводит так
<html>
<table border>

<tr>
<td>
Hello World
</td>
</tr>

</table>
</html>

А как сделать чтоб было так???
<table border bordercolor="#FFFF00" bgcolor="#00FFFF" width="139%" height="62">
<tr>

<td>
<table border>

<tr>
<td>
Hello World
</td>
</tr>

</table>
</td>

</tr>
</table>
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / PHP, Perl, Python [игнор отключен] [закрыт для гостей] / Темплет в темплете???
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]