|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
dhirajpatra Smarty n00b
Joined: 26 May 2007 Posts: 1
|
Posted: Sat May 26, 2007 7:03 am Post subject: How Smarty help PHP |
|
|
Hi Friend
I want to know your opinion regarding how Smarty help to boost the performance with PHP?
And also what is the basic difficulties may arise when a developer will use it for first time ?
regards |
|
Back to top |
|
Dasher Smarty Pro
Joined: 16 May 2007 Posts: 124 Location: Italy
|
Posted: Sat May 26, 2007 7:22 am Post subject: |
|
|
Smarty helps create a logical separation between the business logic and presentation.
It means you don't have to worry as much in your PHP about how information is displayed - leaving that instead to smarty templates.
It boost productivity by allowing reuse of smarty templates and plugins and allows, for projects involving teams of people, people to focus on what they are good at. Designers focus on design - developers focus on logic, processing and storage.
Problems with using smarty for the first time:
1) Don't be over-ambitious - keep your first attempts simple and build upon what you learn
2) While the smarty synatx isn't difficult - it's different from what you might be used to. Understand how it works and why it works the way it does (a good example is escaping variables, the use of backticks, smarty functions & plugins, etc)
3) Resist the urge to put display logic into the business layer. This isn't as easy as it appears:
3.1) People are used to doing things in a particular way - so if you're used to writing HTML tags in PHP you'll find it a hard habbit to break
3.2) Sometimes you need to provide hints to smarty when you want to create something generic. An example is displaying a table. A table is something pretty generic - so it's something that you want to write a single template for and reuse. Where does the information for the columns come from? What about action columns (those that allow deleating, editing, etc)? These kinds of situations you kind of fall into (ie they sneak up on you) - when you start finding yourself in one. Solve the problem and then take a look at what you've done and ask yourself if you've done it in the best way or what else might creap out of the woodwork. By taking a pause and re-analysing what you've done you may find that you can change a few things and make it simpler or more reusable. _________________ General Blog: http://dasher.wordpress.com
VoIP & SIP: http://blog.sipx.ws |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|