Ich versuche, Modul in Prestashop 1.6.1.5 zu ändern. Ich steckte in Smarty auf Druckwert mit foreach Schleife.Smarty multidimensionales Array wie Druckwert
Ich habe in Smarty Array $obchody
Array
(
[0] => Array
(
[id] => 2
[active] => 1
[mesto] => Praha
[vzdalenost] => 86
[name] => Praha - rozvoz
[address1] => Praha
[address2] =>
[postcode] => 10200
[latitude] => 25.94896900
[longitude] => -80.22643900
[hours] => a:7:{i:0;s:0:"";i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";i:4;s:0:"";i:5;s:0:"";i:6;s:0:"";}
[phone] =>
[fax] =>
[note] =>
[email] =>
)
[1] => Array
(
[id] => 3
[active] => 1
[mesto] => Aš
[vzdalenost] => 133
[name] => Aš - rozvoz
[address1] => Aš
[address2] =>
[postcode] => 35201
[latitude] => 25.94896900
[longitude] => -80.22643900
[hours] => a:7:{i:0;s:0:"";i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";i:4;s:0:"";i:5;s:0:"";i:6;s:0:"";}
[phone] =>
[fax] =>
[note] =>
[email] =>
)
[2] => Array
(
[id] => 1
[active] => 1
[mesto] => Liberec
[vzdalenost] => 192
[name] => Liberec - rozvoz
[address1] => Liberec
[address2] =>
[postcode] => 46001
[latitude] => 25.94896900
[longitude] => -80.22643900
[hours] => a:7:{i:0;s:0:"";i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";i:4;s:0:"";i:5;s:0:"";i:6;s:0:"";}
[phone] =>
[fax] =>
[note] =>
[email] =>
)
)
und ich versuche [name]
Wert in meiner Vorlage zu erhalten mit
{foreach $obchody as $obchod}
{$obchod->name}
{/foreach}
Aber ich bekomme immer nur „Hinweis bemerken: Der Versuch, Eigentum zu erhalten von Nicht-Objekt in ... ". Ich versuchte {$obchod[0]->name}
mit demselben Ergebnis. Was mache ich falsch?
@Reginol_Blindhop Haben Sie versucht, die [Dokumentation] (https://www.smarty.net/docs/en/language.variables.tpl) von Smarty zu lesen? – axiac