![]() |
Weird Smarty Bracket Problem
I am displaying data from a table and I am unable to modify the column names. The problem is that one of the column names has brackets in it, for example 'ccost[0]'
When I try to display the value of that column using {$product.proddata.ccost[0]} smarty thinks I am trying to display a value of an array 'ccost' Is there any way to trick smarty into using 'ccost[0]' as the actual fieldname and not a reference to an array? Thanks, Andy |
Re: Weird Smarty Bracket Problem
I would change the query to rename the field on retrieval. e.g.
Code:
SELECT ...,`ccost[0]` AS ccost0, ... FROM .... Another option might be: Code:
{assign var='ccost0' value='ccost[0]'} |
Re: Weird Smarty Bracket Problem
Thanks - the assign var solution worked perfectly.
|
All times are GMT -8. The time now is 01:07 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.