I have been working with a project, using PHP and now have been debating on whether to work with a templating serp. I have produce several solutions, each with different pluses and minuses, and just wanted a 2nd (or many) experiences on personal experience, and effectiveness.
SMARTY
———
This templating engine is so far the most powerful one I’ve seen.
The particular pros
- Allows for Loops, and other functions (more versatile)
- Well supported/documented
- completely separates the markup from your code
The particular cons:
- It’s a big, and can be slow
- It’s not a fairly easy install (ie for the single use)
- You should find out the syntax so as to use it
- newest version is PHP5 only (not a challenge unless webhost wouldn’t provide)
Fundamental tag replacement (including STR_REPLACE OR ANYTHING ELSE… )
the particular pros
- smaller in that case smarty
- simple to utilize requiring only to know basic syntax
- no installing necessary
The particular cons
- Can become complicated to utilize LOOPS, otherwise eliminates customizability
- if certainly not written correctly, can lessen the pace of execution
- may introduce stability holes (in the situation of hand built solutions)
PHP
Utilizing PHP to assign aspects, and then echoing them in the code functionally separating the code by presentation layerthe particular pros
- No installation
- fastest solution
- takes a look at browser caching using a high level regarding effectiveness
- no brand-new language to learn
the cons
- unleashes the electricity of PHP with your templates
- can bring security holes
- your layout artist or else a PHP man or women may break your script
- if utilizing
PHP:
< =$tag>
shorthand it might become unsupported.
Maybe try considering QuickTemplates… The problem with Smarty would be that the loops / judgement is right in the HTML. It clarifies that it’s really messy and hard to maintain. With QuickTemplates, all of the logic is carried out in PHP, and you also just have blocks delineated while in the HTML (with special HTML comments). Then for instance, in the PHP, you’d loop by having a block and set its variables, after which parse & showcase it. It’s also super simple to use & set upwards (in my opinion).
Gives thanks, much appreciated. I do think the biggest issue We’ve with smarty, is that it’s a terrible difficulty to setup, and especially upon my testing host I don’t want to spend a lot of time on configuration.