Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów
[SMARTY] Position module - Wersja do druku

+- Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów (https://www.webmastertalk.pl)
+-- Dział: Technologie internetowe - tworzenie stron WWW (https://www.webmastertalk.pl/forum-technologie-internetowe-tworzenie-stron-www)
+--- Dział: Programowanie, Bazy danych (https://www.webmastertalk.pl/forum-programowanie-bazy-danych)
+--- Wątek: [SMARTY] Position module (/thread-smarty-position-module)



[SMARTY] Position module - seba199696 - 10-03-2012

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

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>

????