Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Is smarty templating system really needed for creating a browser-based game?

Do I need anything else than SQL, PHP, and JS knowledge? \

Note: I also know HTML/CSS so I'd like to work on the game template only after the Database and Coding is done...

share|improve this question

closed as not a real question by Byte56, Jonathan Hobbs, Laurent Couvidou, John McDonald, Martin Sojka Sep 25 '12 at 8:37

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
This isn't a real question. See the FAQ about what types of questions to ask here. –  Byte56 Sep 8 '12 at 18:20
1  
It is a real question, its just not a good fit based on our FAQ :) –  Nate Sep 9 '12 at 0:43
add comment

1 Answer

Smarty is not needed in the sense that you cannot implement a browser-game without it.

In my opinion, a template engine has three main advantages:

  • It helps to enforce MVC. Smarty does this quite well, since you can use native PHP only in plugin functions. (The {php} tag is deprecated from Smarty 3.) If you are new to MVC design, it is worth using Smarty just because of the learning effect it provides.

  • It makes designing view files easier and more secure for non-programmers. This is valuable whenever you have designated frontend-designers who don't know PHP, but still need structs like if-statements, loops, etc. The Smarty syntax is easy to pick up for anybody who already knows HTML, plus you can be (/ make) sure that those designers don't manipulate the objects and variables that you pass to your templates.

  • It provides caching functionality (as well as a couple of non-essential goodies like widgets and handy functions for presentation purposes).

Note that Smarty is not the only engine that provides these advantages, so it is not needed even if you decide to use a template engine.

If you are experienced with MVC software design, don't have any non-programmers for your view files, and already got caching functionality, then don't use Smarty. It will just make your code (a little) slower, and, more important, it will restrict your flexibility by taking away the option to use native PHP in your view files.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.