RE: The problem with Smarty
| From: | Peter Bowyer | Date: | Sun, 17 Feb 2002 09:33:36 +0000 |
| Subject: | RE: The problem with Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2705@lists.php.net to get a copy of this message | ||
At 03:18 AM 2/17/02 -0600, Monte Ohrt wrote:
Two comments: 1) Use the right tool for the job. Smarty may not be well suited for every application, use what is going to make the most sense. I doubt it will ever be the end-all be-all template language for every situation. I'm sure it is overkill for many simple applications that just don't require the breadth of functionality it brings.True, but I like the ease of using custom functions (such as {top_postcards number=5}) which you don't get in other template engines :-) For those who don't understand PHP it makes it much easier for them to insert this kind of thing in the application's page and is more flexible for those with more knowledge to modify than the equivalent written for phplib.
2) You should never have to edit the Smarty class files themselves. Always keep them as-is so to upgrade you simply drop the new files into place. Of course it is easier to have one central installation of the library files, just put them in your include_path. For each application, you create a new instance of the class. Something like this:I'm sure I tried it this way once, and got a fatal error about ./configs path being invalid when I initialised the class. You are right though - this is definitely the best way to do it, and I'll have to have another play. Regards, Peter. Narrow Gauge on the web - photos, directory and forums! http://www.narrow-gauge.co.uk --oOo-- Glenbranter - Scottish narrow gauge in 009 http://glenbranter.narrow-gauge.co.uk --oOo--