Answer the question
In order to leave comments, you need to log in
How to make Smarty composite template correctly?
Hello.
Help solve the issue.
There are 3 patterns. Let's call them header.tpl, index.tpl and footer.tpl.
Hader.tpl - contains the header.
Index.tpl - contains the main content.
Footer.tpl - contains the footer of the page.
All 3 templates should be displayed on the index.php page.
However, when writing in php file
$smarty->display('header.tpl');
$smarty->display('index.tpl');
$smarty->display('footer.tpl');
{include file="header.tpl"}
<div class="container-fluid">
<ul>
{foreach from=$data item=info}
{$info.login}
{/foreach}
</ul>
</div>
{include file="footer.tpl"}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question