Engineer Template

Php Template Engines
Php Template Engines
The overall goal of this article is to advocate the use of template engines in PHP applications and to provide argumentation to support template engine usage. It also contains several examples of template engines, their advantages, and shortcomings, as well as a short guide for selecting the right template engine for your Web-based projects.
What Is a Template Engine
Template engine is in a sense a component that allows separation of php and HTML codes. When template engine is used in the application, HTML code is placed into separate files, templates. In addition to the HTML code, these files contain processing instructions that template engines execute, assembling the final HTML page which is downloaded and converted by browsers into what we see as Web pages. Typically, template engines execute a number of processing instructions, including, but certainly not limited to inserting a value of a certain variable, looping through a set of listings, displaying their titles, and including other template(s).
Key Reason to Use Template Engines
A task of separating the work of programmers from the work of designers is the most typical reason to use template engines in PHP or other languages. Certain authors covering this subject say that with the help of template engines, designers can create the look of a Web page without any substantial involvement of Web programmers. If there is only one person working on a Web application, there is no need for a template engine.
I consider this statement a bit misleading. The biggest advantage of any template engine is to separate the roles of a business domain developer (a programmer), and a front-end developer (designer) even if both roles are performed by the same person. These tasks, while being deeply interrelated, still require different skills and capabilities. When programmers work on the business logic of a website, they need to concentrate on the proper application design, architecture, data structures, business rules, and information storage.
Having that many tasks in mind, one can hardly pay enough attention to the look and feel of the website. When the development of functionality is complete, developers can start working on the appearance of the application. If the business logic code (php) and presentation code (HTML) are mixed, then it takes substantial effort to develop and maintain the appropriate look and feel of Web pages generated by such code. Such approach is slow and error-prone.
With php code separated from HTML code, it is so much easier to maintain both independently, even for a single developer. It allows developers to concentrate on specific tasks, improving the quality of both the implemented functionality and its visual presentation.
Therefore, using template engine benefits Web projects both in short and long term, and that is, regardless of a number or developers working on it.
A Very Basic Php-Based Template Engine
Many opponents of template engine usage (if they still exist) use the following statement as their main argument: PHP itself is a template engine, why use another one on top of PHP? My answer to this is as follows: it is true, there is no need for another one, PHP is well-suited to take care of this issue nicely. However, it all works fine if we keep the business logic and presentation parts of code in different files.
Read the whole article at http://www.worksforweb.com/publications/php-template-engines/.
About the Author
WorksForWeb is a software development company specialized in Web-based applications for the FSBO, agent, and corporate classified portals. WorksForWeb offers SEO-friendly PHP classified solutions with multi-language user interface: iRealty real estate script, iLister listing script and iAuto auto classified script. Additionally, WorksForWeb implements custom classified and industrial solutions and offers visual and code customization services.
|
|
VINTAGE DeHAVILLAND HORNET Twin Engine ELECTRIC 58″WS Plans & Part Templates!!! $0.10 |
|
|
Drafting engineer’s plastic (2) templates circles $3.65 |
|
|
Engineers Drafting and Design Templates – Isometric Piping Drawing Template $3.99 |
|
|
Engineers Drafting and Design Templates – Electronic Symbols Template $3.99 |
|
|
Hangar 9 Engine/Motor Templates: Corsair 50 HAN259019 $4.99 |
|
|
Hangar 9 Engine/Motor Templates: Corsair 50, $4.99 |
|
|
Drafting Engineer’s plastic (4) Templates 1 French Curve Triangles 3 Protractors $5.50 |
|
|
3D FIRE ENGINE KEEPSAKE GIFT PAPER CARD TEMPLATE $7.11 |
|
|
VINTAGE McCOY REDHEAD 60 RC ENGINE OWNER OPERATOR TEMPLATES INSTRUCTION MANUAL $7.95 |
|
|
PRATHER DRILL JIGTAP GUIDE ENGINE TEMPLATE 6-32 #5020 $7.99 |
|
|
PRATHER DRILL JIGTAP GUIDE ENGINE TEMPLATE 6-32 #5000 $8.99 |
|
|
Engine Mounting Templates for Control Line and R/C model Planes $11.95 |
|
|
NEW MECHANICAL WELDING SYMBOLS ENGINEER DRAFT TEMPLATE $12.99 |
|
|
NIP Survey & Civil Engineer TEMPLATE DRAWING GUIDE $14.99 |
|
|
Berol Template – Metric Civil Engineers Radius – R-2127 $15.99 |
|
|
Berol Template – Civil Engineers Radius Guide – R-127 $16.99 |
|
|
Twin Engine Sport Plane/Trainer Plans, Templates, Instructions $17.00 |
|
|
Engineering Services ~ BUSINESS PLAN Template $18.88 |
|
|
Diesel Engine Supplier ~ BUSINESS PLAN Template $18.88 |
|
|
NEW MECHANICAL SCREW DATA SELECTOR ENGINEER TEMPLATE $18.95 |
|
|
Kent Moore J-41480-5 Front & Rear Cover MOD Template GEN III ENGINE $19.99 |
|
|
New RAPIDESIGN ” Civil Engineers Radius Guide TEMPLATE $19.99 |
|
|
Diesel Engine Supplier ~ BUSINESS PLAN Template $20.67 |
|
|
Car & Truck Engine Parts Accessories Designed eBay Template & Banner $29.95 |
|
|
1930 WHIPPET Engine Side Splash Pans – for Repair or for Templates ~Lots of Pics $31.99 |
|
|
LARGE LOT DRAFTING TOOLS Templates Engineering Art Draw $35.00 |
|
|
Diesel Engine Supplier ~ BUSINESS PLAN Template $39.99 |
|
|
Engineering Services ~ BUSINESS PLAN Template $39.99 |
|
|
1962 K&E Engineer Drafting Lettering Set 3 Sizes Doric Template 8935 Orig Box $39.99 |
|
|
Electrical Engineer~ SBA fund ~Template~ Business Plan $39.99 |
|
|
1970 72 CHEVELLE SS & ENGINE SIZE EMBLEM TEMPLATE $49.00 |
|
|
Vtg LOT Drafting Engineering KE Templates C-Thru Timely $50.00 |
|
|
Engineering With the Spreadsheet: Structural Engineering Templates Using… $90.02 |
|
|
Custom Made Chevrolet Script Ball Mill design SBC Chevy Engine Valve Cover Set $399.99 |
|
|
Custom Made Chevrolet Script Ball Mill design SBC Chevy Engine Valve Cover Set $439.00 |
|
|
Chevrolet Ball Mill Design SBC Tall Chevy Valve Cover Set Clears Roller Rockers $499.00 |