Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
[SMARTY] Position module
#1
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>

????
Odpowiedz


Podobne wątki…
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
  Smarty Marys 1 2,324 26-05-2011, 22:10
Ostatni post: Pedro84
  Php, smarty i ilość wyświetleń [nieaktualne] radar 1 1,998 17-10-2010, 18:27
Ostatni post: ixtab

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl