w index.php includuje plik modułu php
zapytanie....
while($rows = $stmts -> fetch()) { $modulee[] = $rows; include('module/' . $rows['name_module'] . '.php'); } $stmts -> closeCursor(); $smarty->assign('modulee', $modulee);
i teraz w pliku index.tpl chcę ładować te moduły w miejscu którym użytkownik sobie życzy (mam tablice 'module' i pole 'position')
index.tpl:
<!-- position 0 - left position 1 - right --> <div style="float: left;" {foreach $modulee as $item} {if $item['position'] == 0} {include file="module_tpl/`$item['name_module']`.tpl"} {/if} {/foreach} </div> <div style="float: right;"> {foreach $modulee as $item} {if $item['position'] == 1} {include file="module_tpl/`$item['name_module']`.tpl"} {/if} {/foreach} </div>