Witam.
Czy ktoś mi może powiedzieć, jak to powinno wyglądać i co źle robię? Bo mnie zaraz cos "trafi" :/.
Mam taki problem:
Mam tablicę postaci:
array(1) {
[1]=>
array(1) {
[1]=>
array(3) {
["value"]=>
string(1384) "jakis tam string"
["type"]=>
string(4) "text"
["other"]=>
NULL
}
array(1) {
[2]=>
array(3) {
["value"]=>
string(1384) "jakis tam string2"
["type"]=>
string(4) "text"
["other"]=>
NULL
}
}
[2]=>
array(1) {
[1]=>
array(3) {
["value"]=>
string(1384) "jakis tam string"
["type"]=>
string(4) "text"
["other"]=>
NULL
}
array(1) {
[2]=>
array(3) {
["value"]=>
string(1384) "jakis tam string2"
["type"]=>
string(4) "text"
["other"]=>
NULL
}
}
}
przekazuję ją do szablonu: $smarty->assign('item', $data);
nastepnie chce wyswietlic jej cala zawartosc w szablonie i nie wiem jak to uczynić:(. Męczę się już z tym drugi dzień.
Próbowałem na wiele sposobów, ostatni wygląda tak:
{section name=x loop=$item}
{section name=y loop=$item[x]}
{$item[x][y].type}
{if $item[x][y].type=="text"}
<p>{$item[x][y].value}</p>
{/if}
{/section}
{/section}