Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9191663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:44:21+00:00 2026-06-17T20:44:21+00:00

I just started using Smarty today so I may be doing this completely wrong,

  • 0

I just started using Smarty today so I may be doing this completely wrong, but I can’t seem to find a solution to the problem. I’m trying to get a for loop to iterate 4 times, incrementing $i on each iteration. Pretty standard stuff.

According to the Smarty documentation, for loops should be of the following form:

{for $var=$start to $end}

My current loop statement is as follows:

{for $i=0 to 3}

But I am getting the following error at runtime:

Fatal error: Smarty error: [in ..views/landing/index.tpl line 69]: syntax error: unrecognized tag ‘for’ (Smarty_Compiler.class.php, line 590) in ../library/1.11/Smarty/Smarty.class.php on line 1093

The loop is on line 69 which is the line that the compiler is failing on. I’ve also shortened the urls in that error message for easier reading.

I’m not sure what I’m doing wrong here. I’ve tried googling various parts of the error message, but to no avail.

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:44:22+00:00Added an answer on June 17, 2026 at 8:44 pm

    Apologies. Just realised our server is running Smarty V2. For loops weren’t introduced until V3. If anyone else is having this problem and are, like me, unable to upgrade look up the {Section} and {foreach} tags. They are available in V2 and might be able to do what you need them to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started using smarty but i have some problems to find a proper
Just started using App Engine's webapp framework, but I can't figure out what's wrong
I just started using pixel shaders with xna, but I can't wrap my head
I just started using MagicalRecord, and this might be a stupid question, but it's
I just started using Eclipse but already I have a small problem. At first
I just started using Laravel. When I use codeigniter or zend framework, I can
I just started using PrimeFaces and cannot figure what is wrong with my code.
I just started using Git and I want to know if this is the
I just started using the document class in flash cs6 today... so I learned
I just started using the documentclass in flash... but i am already hitting problems..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.