|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
tsmtsm Smarty n00b
Joined: 24 Mar 2007 Posts: 3
|
Posted: Sat Mar 24, 2007 6:23 pm Post subject: period in field name, how to handle in section? |
|
|
Hello fellow smarties,
I tried by myself and also searched here and there but could not find the correct way to do this.
Here's the problem.....
We ve got a Mysql DB Backend with Fieldnames like this "blabla.bla". (In this case the left of the period is not the table name.)
The following code doesn't work because of the "." in the fieldname.
=========================
{section name=data loop=$result}
<tr>
<td scope="col">{$result[data].InfoPolicy.ID}</td>
<td scope="col">{$result[data].InfoPolicy.ObjectID_FK}</td>
<td scope="col">{$result[data].InfoPolicy.IssueDate}</td>
</tr>
{/section}
=========================
I also tried with backticks on the whole resultstring as well as partially... somehow just trying to be lucky with the code:D.
However I couldn't figure it out..
Can anyone help me with this?
Thank you very much. |
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Sun Mar 25, 2007 4:29 am Post subject: |
|
|
Modify your abstraction layer to rename all column names, replacing . with _
Good luck! |
|
Back to top |
|
tsmtsm Smarty n00b
Joined: 24 Mar 2007 Posts: 3
|
Posted: Sun Mar 25, 2007 6:32 am Post subject: |
|
|
toma wrote: | Modify your abstraction layer to rename all column names, replacing . with _
Good luck! |
Thank you Toma,
Yes, this was the next thing i was about to do if there would be no solution from within smarty. I wonder though, is there no way to escape it somehow, and pass it on as a fieldname instead of a nested array (as the punctuation suggests) ? I think I will dive into the the secrets of smarty now.
Thank you again Toma |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|