Until now I developed most of my projects using asp.net. Only last month I only learned PHP (PHP: Hypertext Pre) is a programming language designed to produce dynamic web pages. PHP is a language of open source and free software be considered by the Free Software Foundation. Today, I found Smarty and have been using it in my projects.
Now the question is why we use Smarty and what is the purpose of using it ...???
Traditionally, when you do a web application using php, Html and php scripts are mixed in a single file. Often, a developer finalizes a project complete, and someone suggests that the font and the color background chosenhe / his choice not coincide with their requirements. The programmer then hasve to search through dozens of php files and modify the HTML code that has been incorporated within simply to change the appearance of the site and change all the other properties. Editing the files php greatly increases the chance of generatinge new errors or bugs. It will be much easier when you separate the HTML of your PHP code and will also make it much easier to reuse your PHP code on the road in other projects.
So the above solution can be applied, using the technology as Smarty, it allows you change the appearance of your web site, changing an HTML file template. It also allows you to do is simple statements, repeating blocks dynamic, and variable substitution.
The basic use of Smarty is for separation of business logic and presentation logic, creates web content by the placement of labels special Smarty within a document. Thus, 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 model development, designers are hiding the back-end coding and PHP programmers are hidden coding.
Tasks the presentation of both designer and programmer are is:
Programmer & 39; s Mission:
-> Collecting Data the database by firing simple queries to it. -- > Manipulate or validate the data by conducting business logic on it. -- > The best thing is that we can change the way data access of MySql to another without interfering with the designer of work.
Designer & 39; s Task:
-> Creating pages HTML without affecting php scripts, but is concerned about putting content elements on the right place Where the developer agreed to provide.
Some of the attractive features of the use smarty areis as follows:
1) Fast: Smarty is extremely fast, making Model Compiling means he reads the models, creates php scripts and include files php that is finally Compilados by php engine .. The best thing is that the models are examined only once a smarty if it is not changed again .. This results in a quick compilation and better performance.
2) recovery: Smarty has built up a model of recovery achievements. She takes the result of the model of content and thus saves the overhead to retrieve data from data source.
3) Variable Modifiers: Smarty provides variable modifiers in order to modify the contents of a variable as string to convert capitalized or tiny things or truncating etc. Like much easily
4) Model Function: Smarty provides some builtin functions and custom as looping function as declarations or loops etc.Or simply write a line of a simple code that will generate a radiobuttons or civil or otherwise checks to 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 who no longer need to mix PHP code with HTML code. Just take care of business logic and leave HTML to designer
Now the issue of purifying the smarty php scripts. Nusphere provides PHP Editor for editing and debugging .. Ii ss & 39; latest version is PhpEd version 4.6.2 was released with full support for PHP 5.2.
The definitive resource for learning Smarty smarty.php.net is where you get all Stuffs related to Smarty.
Author: By Nishant Bharathan Nishant Bharathan is working as a Jr. Programmer in Semaphore Infotech Pvt. Ltd, India. He has 8 months of experience. Net programming. You can contact in the e-mail: nishant@semaphore-software.com. genny gertrudis
Bookmark it:
Monday, March 17, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment