10-03-2012, 22:14
Napisałem wyświetlanie modułów co o tym myślicie?
w index.php includuje plik modułu php
zapytanie....
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:
????
w index.php includuje plik modułu php
zapytanie....
Kod:
$modulee = array();
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:
Kod:
<!--
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>
????