Home Add to Favorite Contact Submit  
             25 April, 2024
 

    
Category:  Articles » Internet » Web Development

 

PHP Template Engines

Popularity:
         Views: 1920
2011-03-13 01:19:28     
Article by Max Kosyakov

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.

Specialized in: Php Template Engines - Template Engine - Key Reason To Use Template Engines - Php-based Template Engine - Smarty Template Engine - Phptal Template Engine - Phptal - Template Engines Usage
URL: http://www.worksforweb.com
Print article      Bookmark this page
Related Articles 
Four Reasons Why Mobile Applications Are Adept At Amplifying Attention (Popularity: ): Given the abilities of technologies, we can pronounce that the production of a mobile application can be of great advantage to an enterprise. A well crafted mobile application is beautifully amiable when it comes to approaching your potential clients with irresistible functionalities that let them get engaged in your product. Flexbox Digital offers you an ultimate range and sets of plans to approach your newly found business with accuracy and ...
Discover Reasons Why You Should Hire Sun-Softwares for your Complete IT Solutions (Popularity: ): Today is the world of internet and every businessman who wants to grow their business, while embracing online marketing strategies. Promoting business through online not only attracts the number of visitors but also helps in boosting up the companies presence on the global basis. For this reason, it is very essential to hire a professional and experienced service provider who could offer a new edge of growth to your business. ...
Idyllic Android Application Development for Better Business Profit (Popularity: ): iPhone and Android are the technology hub for everyone. Mobile is the only way to be in contact with latest technologies. All mobile manufacture companies have heavy competition between them. They fight to get customers and launch their new mobiles with latest technologies. Of course, a benefit goes to buyers. There are a huge number of applications for every type of business. Users like to use application in place of ...
How Good Web Development Elements Can Make You Prosperous Online (Popularity: ): When you’re considering setting up a website to promote your online business, it must be all things to all people. That is, it must be interesting, eye-catching, mentally stimulating and must have enough of a pull to keep visitors coming back frequently. What are these features that can be woven into the web development of your site? Here are a few that can make your site stand apart:Don’t use introduction ...
Web designing services (Popularity: ): As your website forms a core part of your marketing strategy, to gain success in today's competitive market, creating aesthetically pleasing websites with a professional touch which will promote your business and help you stay ahead. To design a website, selecting website designers with several years of expertise is a must. They will create designs that are a class apart in terms of creativity, usability and higher ROI. Experienced web ...


Related Business 
Timothy PHP Framework (Popularity: ): Our PHP Template collection includes over 30 professionally designed PHP Templates that are easy to use and make it fast and simple to publish and easy to maintain PHP website. PHP tutorial template are not meant to be heard or listened too or even spoken. PHP tutorial scripts are learnt by people in order to be written and then 'read' and operated by computers alone.
Smarty PHP Framework (Popularity: ): Smarty is a free and open source web template system written in PHP which considers that PHP code is application logic and has to be separated from the presentation. It is one of the most flexible tools for PHP. A template system is an essential part of a website as it separates the design elements from programming codes. Smarty helps the graphic designers achieve an innovative look for a website ...
Yapig - Yet Another PHP Image Gallery (Popularity: ): Yapig is a simple image gallery written in php. It has web admin tool, template system, user comments, visit stats and multilingual support. Requires GD lib, but no SQL. [GPL]
Open Site Builder (Popularity: ): Provides website compilation from predefined template and content files (PHP) [OS Independent]
Web Templates and Website Templates with Webpage Templates (Popularity: ): Template Wonderland is a Template selling website which provides all category Templates relatively in low cost. We offer various kinds of professional templates like, Travel website Template, Real Estate Website Templates, Game Website Templates, Agriculture Website Template and many more.
PHP Development, PHP Web Development, PHP Application Development, PHP Development Company (Popularity: ): PHP development is one of the most diverse development platforms, to build complex web applications and web portals. PROVAB has 120+ strong PHP developers to engage global clients and deliver them scalable & robust PHP development projects. http://www.provab.co.in/php-development.html
bBlog (Popularity: ): A feature packed template based blogging tool, written in PHP with Smarty templates, released under the free GPL licence.
Expert PHP Programmer (Popularity: ): Hire PHP programmer/PHP developers from vEmployee for Expert PHP Programming Services. Our PHP programmer/developer can do integrated PHP solutions, PHP web application development, SOAP, web services, database applications, PHP multiplatform development.
PHP Matrimonial Script (Popularity: ): PHP Matrimonial Script With the professionally developed Classified script can Visitors post Classifieds and use many new Features.our Professional matrimonial Software is search Engine friendly to gain better Promotion Aspects at search Engines.
5th Avenue Software (Popularity: ): A template-driven customizable PHP shopping cart utilizing MySQL or PostgreSQL. Interfaces with numerous payment, tax, and freight methods. [Shareware]