tpl file) with an associated Smarty plug-in file (a .php file).We add the Smarty plug-in to the scene
when your template needs to display data dynamically??”in which case the plug-in contains the presentation
logic that gathers the necessary data and feeds it to the template. When you need to display static content
such functionality isn??™t needed, and a Smarty design template would suffice. You??™ll learn how to work with
Smarty plug-ins in Chapter 4. Their official documentation page is http://smarty.php.net/manual/en/
plugins.php.
In Figure 3-6, you can see some of the Smarty componentized templates you??™ll build in
the next few chapters. The site contents box will be generated by a simple Smarty design template,
named store_front.tpl, that you??™ll build later in this chapter. In Chapter 4, you??™ll extend
it to a Smarty componentized template, when you??™ll need to generate dynamic content.
Figure 3-6. Using Smarty to generate content
Using Smarty templates to implement different pieces of functionality provides the benefits
discussed in Chapter 2. Having different, unrelated pieces of functionality logically separated
from one another gives you the flexibility to modify them independently and even reuse them in
other pages without having to write their code again. It??™s also extremely easy to change the place
in the parent web page of a feature implemented as a Smarty template.
Pages:
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109