Napisałem wyświetlanie modułów co o tym myślicie?

w index.php includuje plik modułu php

zapytanie....
  1. $modulee = array();
  2.  
  3. while($rows = $stmts -> fetch())
  4. {
  5. $modulee[] = $rows;
  6. include('module/' . $rows['name_module'] . '.php');
  7. }
  8.  
  9. $stmts -> closeCursor();
  10.  
  11. $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:

  1. <!--
  2. position 0 - left
  3. position 1 - right
  4. -->
  5.  
  6. <div style="float: left;"
  7. {foreach $modulee as $item}
  8.  
  9. {if $item['position'] == 0}
  10. {include file="module_tpl/`$item['name_module']`.tpl"}
  11. {/if}
  12.  
  13. {/foreach}
  14. </div>
  15.  
  16. <div style="float: right;">
  17. {foreach $modulee as $item}
  18.  
  19. {if $item['position'] == 1}
  20. {include file="module_tpl/`$item['name_module']`.tpl"}
  21. {/if}
  22.  
  23. {/foreach}
  24. </div>