Keith Watanabe * NET 2.0

Smarty Plugins and Objects
By: Keith Watanabe
Published On: 5-23-2005

One massive complaint I have is that there's no inherent mechanism for re-use within the Smarty plugin structure. With, for instance, Template Toolkit, you inherit from the template parent class to create a new plugin. The benefit of that is that you can re-use and expand on base classes that attempt to perform larger scale functionality, like a calendar object. However, there is an easy way around it: adding classes in the Smarty plugin directory and using functions as wrappers to those objects. By doing it that way you can easily create your own reusable plugin objects and having the functions acting as factories or wrappers around them. Actually, this is a slick way of condensing your view code since you don't have to do a ton of setup, except in the parameters section of the function call in the template.

Tags: php
AddThis Social Bookmark Button Sphere: Related Content

Trackbacks: (Trackback URL)

No Comments Posted Yet
December [January] February
Sun Mon Tue Wed Thu Fri Sat
28 29 30 31 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31