Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][Smarty] Smarty - pętla foreach
elldiablo
post
Post #1





Grupa: Zarejestrowani
Postów: 79
Pomógł: 1
Dołączył: 30.05.2009

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


Witam,

Mam tablicę, którą chciałbym wyświetlić w szablonach smarty:
  1. array(9) {
  2. [0]=>
  3. object(stdClass)#7 (1) {
  4. ["my-account-array"]=>
  5. array(36) {
  6. [0]=>
  7. string(10) "1215638992"
  8. [1]=>
  9. string(4) "0.00"
  10. [2]=>
  11. string(4) "0.00"
  12. [3]=>
  13. string(4) "0.00"
  14. [4]=>
  15. string(6) "180.00"
  16. [5]=>
  17. string(1) "1"
  18. [6]=>
  19. string(19) "2010-10-22 15:28:48"
  20. }
  21. }
  22. }


w php zrobiłem coś takiego

  1. $tablica - to jest tablica
  2. $ids = array();
  3. foreach($tablica as $key) {
  4. $ids[] = $key->{'my-account-array'}['0'];
  5. $ids[] = $key->{'my-account-array'}['1'];
  6. }

dane wyświetlają się ok,
Jak można zrobić to w smarty?

Ten post edytował elldiablo 27.10.2010, 08:33:21
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 19.08.2025 - 15:19