Reputation: 18006
hi I am developing a module in oxid-esales. It use smarty templates. Now I want to get a particular array index. My code looks like
[{foreach from=$language item=lang}]
<div id="stores">
[{if !array_key_exists($lang->id,$language_array)}]
<img src="[{$join_image}]" /> <input type="radio" name="sys_lang" id="sys_lang" />[{$lang->name}]
[{else}]
<img src="[{$join_image}]" /> [{$lang->name}] [{$language_array[$lang->id]}]
[{/if}]
</div>
[{/foreach}]
But it is creating a fatal error of
Fatal error: Smarty error: [in froomerce_fconnect.tpl line 74]: syntax error: unrecognized tag: $language_array[$lang->id] (Smarty_Compiler.class.php, line 446) in D:\wamp\www\oxid_froomerce\core\smarty\Smarty.class.php on line 1093
I have searched and all where the proper syntax for getting variables in smary is only putting{}
brackets. But the CMS oxid enforces me to use [{}]
for variables.
Does any body how can I get the value of particular index of array like this
[{$language_array[$lang->id]}]
Regards, Awais Qarni
Upvotes: 0
Views: 984
Reputation: 3921
Try to change default smarty delimiters. For example:
$smarty->left_delimiter = '[{';
$smarty->right_delimiter = '}]';
See http://www.smarty.net/docsv2/en/language.escaping.tpl
Upvotes: 1