Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Pętla
seba199696
post 7.03.2012, 21:36:57
Post #1





Grupa: Zarejestrowani
Postów: 119
Pomógł: 0
Dołączył: 4.01.2011

Ostrzeżenie: (20%)
X----


Jak zapętlić coś takiego:

zapytanie...

  1. $smarty->assign($row['name_module'], $module_tpl.$row['name_module'].".tpl");
  2. include($module.$row['name_module'].".php");


chodzi mi o coś takiego:

  1. $smarty->assign($row['name_module'], $module_tpl.$row['name_module'].".tpl");
  2. include($module.$row['name_module'].".php");
  3.  
  4. $smarty->assign($row['name_module'], $module_tpl.$row['name_module'].".tpl");
  5. include($module.$row['name_module'].".php");


Ten post edytował seba199696 7.03.2012, 21:38:28
Go to the top of the page
+Quote Post
PiotrekM
post 7.03.2012, 21:40:32
Post #2





Grupa: Zarejestrowani
Postów: 130
Pomógł: 6
Dołączył: 20.12.2009

Ostrzeżenie: (0%)
-----


chcesz wyświetlić moduły w pętli?
Go to the top of the page
+Quote Post
seba199696
post 7.03.2012, 21:41:43
Post #3





Grupa: Zarejestrowani
Postów: 119
Pomógł: 0
Dołączył: 4.01.2011

Ostrzeżenie: (20%)
X----


nom smile.gif jak takie coś się robi?
Go to the top of the page
+Quote Post
PiotrekM
post 7.03.2012, 21:44:01
Post #4





Grupa: Zarejestrowani
Postów: 130
Pomógł: 6
Dołączył: 20.12.2009

Ostrzeżenie: (0%)
-----


musisz mieć tablicę z modułami, jeżeli już masz to wyświetlasz w pętli:
  1. foreach($modules as $item)
  2. {
  3. $smarty->assign($item['name_module'], $module_tpl.$item['name_module'].".tpl");
  4. include($module.$item['name_module'].".php");
  5. }


Ten post edytował PiotrekM 7.03.2012, 21:44:11
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 7.07.2025 - 05:52