|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home | FAQ | About Us | Contact Us | Site Map | Exchange Links | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Article Directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Articles AreaHome Login / Register Browse Articles Search Articles Submit an Article Get RSS Feeds Add Free Article Content Most Viewed Latest Articles Article RatingsGuidelinesAuthors PublishersPartnersArticlesArea |
Home |
Computers-and-Technology |
Personal-Tech | Php using Smarty ...Php using SmartySubmitted by semaphore on Monday Feb 19, 2007 and viewed 4992 timesTotal Word Count: 681 Author Rating: NA Rate this article
|
Publisher
|
Print
The basic use of Smarty is for separation of business logic and presentation logic, generates web content by the placement of special Smarty tags within a document. So it allows the presentation of a web page to change separately from the back-end, thus allowing applications to be developed in a more organized fashion. Using this development model, designers are hidden from the back-end coding and PHP programmers are hidden from the presentation coding.
Till now i developed most of my projects using asp.net. Just last month only i learned PHP (PHP: Hypertext Preprocessor) is a programming language designed for producing dynamic Web pages. PHP is an open source language and considered to be free software by the Free Software Foundation. At this time, i discovered Smarty and have been using it in my projects. Now the question is why do we use Smarty and what is the purpose of using it...??? Traditionally, when you make a web application using php, html and php scripts are mixed in one file. So the above solution can be applied by using Smarty technology as, it allows you to change the appearance of your web site by changing an HTML template file. It also allows you to do simple if statements, dynamic repeating blocks, and variable substitution. The basic use of Smarty is for separation of business logic and presentation logic, generates web content by the placement of special Smarty tags within a document. So it allows the presentation of a web page to change separately from the back-end, thus allowing applications to be developed in a more organized fashion. Using this development model, designers are hidden from the back-end coding and PHP programmers are hidden from the presentation coding. Tasks of both designer and programmer are is as follows : Programmer's Tasks: -> Fetching data from database by firing simple queries to it. Designer's Task: ->Creating HTML pages without affecting php scripts , only concerned is with placing content elements on the right place where the programmer has agreed to provide. Some of the attractive features of using smarty areis as follows : 1) Fast : Smarty is extremely fast by doing Template Compiling, means it reads the templates, creates php scripts and include the php files which is finally compiled by php engine..The best thing is that the templates are parsed only once by smarty if it is not modified again.. this results in to fast compilation and better performance. 2) Catching : Smarty has built-in catching of your template outputs. It catches the output of the template contents and thus saves the overhead of retrieving the data from data source. 3) Variable Modifiers : Smarty provides variable modifiers in order to modify the contents of a variable like converting string to uppercase or lowercase or truncating etc things like that very easily 4) Template Function : Smarty provides some builtin and custom functions like looping function like if statements or for loops etc.Or just write a simple one line code which will generate a radiobuttons or calendar or other form controls which make things faster and more simple.r. Smarty is a great tool for both designers and developers. By using Smarty you can reduce the site development and maintenance times. If you are a developer you no longer need to mix PHP code with HTML code. Just take care of business logic and leave the HTML to the designer Now the matter of debugging the smarty php scripts. Nusphere provides PHP Editor for editing and debugging..Ii’ss latest verison is PhpEd version 4.6.2 has been released with full support for PHP 5.2. The definitive resource for learning Smarty is smarty.php.net,where you will get all the stuffs related to Smarty. ArticleSource: ArticlesAlley.com
Number of ratings: 0
Rating: 0 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| © Copyright ArticlesAlley.com - All Rights Reserved Worldwide. | Privacy Policy | Terms of Use | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||