SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smarty- How can I display this?

    Hi guys

    I am now using the Smarty template engine

    I have run into a little issue.

    This my previous code

    PHP Code:
    $current time();
    for(
    $i 0$i 60$i++){

    $current strtotime("+1 day"$current);
    echo
    "$current<br />";} 
    This displays the next 60 days. My problem is how can I display this in smarty as I need the php code to run the loop around the echo statement

    Regards

    Chris

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because that effectively is business logic, you technically should generate it as part of your PHP script and assign it to a template variable (an array).

    However, Smarty has tags to execute raw PHP too.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •