{include } - не инклудит!

KiriX

Guest
{include } - не инклудит!

Товарищи коллеги! При использовании Смарти я столкнулся с такой проблемой функция шаблона {include file=”tplname.tpl”} не инклудит дочерний шаблон в родительский. tplname.tpl находиться в той же директории что и основной шаблон, $smarty->template_dir указана правильно, если указать неправильное имя дочернего шаблона выводит
Warning: Smarty error: unable to read resource: "incorect.tpl" in /home/user/public_html/smarty/Smarty.class.php on line 1102 Отсюда делаю вывод что Смарти видит этот шаблон но почему то не инклудит. Помогите разобраться в чем дело. Заранее благодарен.
 

Demiurg

Guest
кеширование включено ?
удали все прекомпиленные шаблоны.
 

KiriX

Guest
parent template:

<form method="POST" name="mform">
<table cellpadding="0" cellspacing="0" border="0" width="425px" align="center">
{foreach name=outer item=category from=$elements}
<tr valign="middle">
<td width="100%">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
{if $category.caption }
<td width="30%"><b>{$category.caption}</b></td>
{/if}
{if $category.type == "html_checkboxes"}
{section name=i loop=$category.values}
{if !($smarty.section.i.iteration mod 4) }
</td>
</tr>
</table>
</td>
</tr>
<tr valign="middle">
<td width="100%">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="30%">&nbsp;</td>
{/if}
<td width="23%" nowrap><input type="checkbox" name="{$category.name}" value="{$category.values}"><b>{$category.output}</b></td>
{/section}
{elseif $category.type == "html_options"}
<td >
{html_options name=$category.name values=$category.values output=$category.output }
{/if}
</b>
</td>
</tr>
</table>
</td>
</tr>
{/foreach}
<tr valign="middle" height="30px">
<td align="center">
<input type="image" src="{$IMG_DIR}make.gif" onMouseOver="this.src='{$IMG_DIR}make_o.gif'" onMouseOut="this.src='{$IMG_DIR}make.gif'" border="0">
&nbsp;&nbsp;
<img src="{$IMG_DIR}cancel.gif" onMouseOver="this.src='{$IMG_DIR}cancel_o.gif'" onMouseOut="this.src='{$IMG_DIR}cancel.gif'" border="0" onClick="document.location='{$HTTP_ROOT}about.html'" style="vertical-align:top; cursor:hand">
</td>
</tr>
</table>

{include file="setmail.tpl"}

<table cellpadding="0" cellspacing="0" border="0" width="400px" align="center" id="fax" style="display:none; margin-top:15px" >
<tr valign="middle" height="30px">
<td align="right">
<b>Enter tel number:</b>&nbsp;
</td>
<td >
&nbsp;<input name="faxnumber">
</td>
</tr>
</table>
<input type="hidden" name="make" value="1">
</form>

child template
("setmail.tpl'):

<table cellpadding="0" cellspacing="0" border="0" width="400px" align="center" id="mailTbl" style=" margin-top:15px"
<tr valign="middle" height="30px">
<td align="right">
<b>{$sendmail_title}</b>&nbsp;
</td>
<td
&nbsp;<input name="mail">
</td>
</tr>
</table>
 

tony2001

TeaM PHPClub
теперь сделай так, чтобы оба шаблона занимали не более 5-ти строк.
выключи кэширование, как уже сказал Демиург, и скажи нам версии Apache, PHP, OS, Smarty.
 

KiriX

Guest
Спасибо Demiurg ! помогло удаление прекомпиленныx шаблонoв!
Всем спасибо за участие.
 
Сверху