Hey guys,
For the love of all things holy I can't figure out how to add two numbers together in smarty. I've checked the manual, there's no main section, if it's in there, it's probably lost within some section.
I've tried {2+3}, {(2+3)}.
What i'm trying to do is add a number of days to a date. I have a list of objects, and a member of the object is a date (start date). These "things" expire within 45 days, so what I need to do is show the expiration date.
My object does not have a expireDate member and I don't want to change my array of objects to an array of array and add the expiration date on the PHP side, too resource intensive.
Any clue?
Here's the TPL code:
Thanks everyone,
Dan
For the love of all things holy I can't figure out how to add two numbers together in smarty. I've checked the manual, there's no main section, if it's in there, it's probably lost within some section.
I've tried {2+3}, {(2+3)}.
What i'm trying to do is add a number of days to a date. I have a list of objects, and a member of the object is a date (start date). These "things" expire within 45 days, so what I need to do is show the expiration date.
My object does not have a expireDate member and I don't want to change my array of objects to an array of array and add the expiration date on the PHP side, too resource intensive.
Any clue?
Here's the TPL code:
Code:
<ol>
{foreach from=$resultVOList item="postVO"}
<li><a href="#" class="postLink">{$postVO->title}</a> — {$postVO->location} — <b> ${$postVO->price} </b>
<br /><b>Author:</b> {$postVO->author}
<br /><b>ISBN:</b> {$postVO->ISBN}
<br /><b>Created:</b> {$postVO->datePosted|date_format}
<br /><b>Expires:</b> {2+3}
<div class="right"> <a href="#">[ Edit ]</a> - <a href="#">[ Delete ]</a></div>
<div class="hrzln" ></div></li>
{foreachelse}
<li>No Book Posts, click on New Post to add a book for sale</li>
{/foreach}
</ol>
Dan
Comment