{"id":7174,"date":"2014-05-27T08:58:09","date_gmt":"2014-05-27T08:58:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/27\/how-to-assign-multidimensional-array-to-class-as-argument-collection-of-common-programming-errors\/"},"modified":"2014-05-27T08:58:09","modified_gmt":"2014-05-27T08:58:09","slug":"how-to-assign-multidimensional-array-to-class-as-argument-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/27\/how-to-assign-multidimensional-array-to-class-as-argument-collection-of-common-programming-errors\/","title":{"rendered":"How to assign multidimensional array to class as argument?-Collection of common programming errors"},"content":{"rendered":"<p>If I try to assign a multidimensional array to a class i get this error<\/p>\n<pre><code>            {Widgets-&gt;Widget\n                    media='videos'\n                    filters=Array('a' =&gt; 'b', 'c' =&gt; 'd')\n            }\n\n \"{assign var='X' value = Array('a' =&gt; 'b', 'c' =&gt; 'd')}\" - Unexpected \" =&gt; \", expected one of: \"\",\"\" , \")\"'\n\nthis doesn't work as well\n            filters['a']='b'\n            filters['c'] = 'd'\n<\/code><\/pre>\n<p>is there a way to circumvent this limit? the version of smarty I&#8217;m using is the latest.<\/p>\n<p>the documentation isn&#8217;t very clear about it: http:\/\/www.smarty.net\/docs\/en\/advanced.features.objects.tpl<\/p>\n<p>regards<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If I try to assign a multidimensional array to a class i get this error {Widgets-&gt;Widget media=&#8217;videos&#8217; filters=Array(&#8216;a&#8217; =&gt; &#8216;b&#8217;, &#8216;c&#8217; =&gt; &#8216;d&#8217;) } &#8220;{assign var=&#8217;X&#8217; value = Array(&#8216;a&#8217; =&gt; &#8216;b&#8217;, &#8216;c&#8217; =&gt; &#8216;d&#8217;)}&#8221; &#8211; Unexpected &#8221; =&gt; &#8220;, expected one of: &#8220;&#8221;,&#8221;&#8221; , &#8220;)&#8221;&#8216; this doesn&#8217;t work as well filters[&#8216;a&#8217;]=&#8217;b&#8217; filters[&#8216;c&#8217;] = &#8216;d&#8217; is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7174","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7174"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7174\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}