edit:
haha, smilie moet smarty zijn
haha, smilie moet smarty zijn

Ik heb een stukje code waarmee ik reacties kan maken net zoals ze hier op t.net hebben, dus geneste reacties. De php kant ervan lukt allemaal wel, en het poept de volgende array uit;
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
| Array ( [0] => Array ( [ID] => 1 [parentID] => 0 [content] => Leuk bericht! [depth] => 1 [children] => Array ( [0] => Array ( [ID] => 5 [parentID] => 1 [content] => Waarom nou weer leuk! [depth] => 2 [children] => Array ( [0] => Array ( [ID] => 6 [parentID] => 5 [content] => Waarom nou weer niet leuk! [depth] => 3 [children] => Array ( ) ) ) ) ) ) [1] => Array ( [ID] => 2 [parentID] => 0 [content] => Ja, vind het ook wel leuk. [depth] => 1 [children] => Array ( [0] => Array ( [ID] => 3 [parentID] => 2 [content] => Ik ook! [depth] => 2 [children] => Array ( ) ) ) ) [2] => Array ( [ID] => 4 [parentID] => 0 [content] => Nee, ik niet! [depth] => 1 [children] => Array ( ) ) ) |
maar nu zit ik met het probleem om het in smarty door te laten lopen en te laten zien. Zelf dacht ik aan zoiets als dit, maar het klopt niet
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| {capture name=post} {section name=child loop=$replies[children]} {$replies[children][child].content} <hr> {/section} {/capture} {section name=parent loop=$replies} {$smarty.capture.post} {/section} |
iemand verstand van smarty en weet hoe ik dit werkend kan maken?
[ Voor 11% gewijzigd door Verwijderd op 01-07-2004 17:21 ]