SMARTY is a neat templating engine and a nice compliment to PHPOpenBiz. In this Guide, I'll explain how I supply SMARTY with variables that contain my own custom business logic. The end result is a was to feed SMARTY templates variables containing simple arrays, strings or even full fledged blocks of HTML code. The advantage is that OpenBiz can handle the scripting and feed SMARTY the end results in the form of HTML code or simple arrays to loop through. This strategy makes it easier to separate logic and theme data. The 30 second version is: Than create child classes that override the GetCustomVariables($smarty) function adding new vars as needed. Once inside your custom child class that extends either BizForm or BizView you have plenty of room to operating in creating as many custom variables as you wish. You have access to the usual OpenBiz classes including that Forms BizDataObject. TODO: What about making this a default feature within the BizForm and BizView?
|
|||
