Darreugne Posted March 18, 2013 Share Posted March 18, 2013 Hey, I want to make this : {foreach from=$history item=entry} <tr> <td>{php} echo date("Y-m-d H:i:s", $entry.timestamp); {/php}</td> <td>{$entry.code}</td> <td>{$entry.credit_added}</td> </tr> {foreach} But the first field stay empty.. Any idea ? Thanks 0 Quote Link to comment Share on other sites More sharing options...
Darreugne Posted March 21, 2013 Author Share Posted March 21, 2013 UP ? I really need help about this 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted March 21, 2013 Share Posted March 21, 2013 PHP will not be able to read the entry variable in the smarty foreach look which is why it is blank. It looks like you just trying to format the date which can be done in smarty instead: {$entry.timestamp|date_format:"%Y-%m-%d %H:%i:%s"} http://www.smarty.net/docsv2/en/language.modifier.date.format 0 Quote Link to comment Share on other sites More sharing options...
Darreugne Posted March 21, 2013 Author Share Posted March 21, 2013 Seems good Many thanks 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.