Although it is indeed a language
unto itself, its syntax is such that a designer can quickly pick up on it without
prior programming knowledge.
Template compilation: To eliminate costly rendering overhead, Smarty converts
its templates into comparable PHP scripts by default, resulting in a much faster
rendering upon subsequent calls. Smarty is also intelligent enough to recompile
a template if its contents have changed.
Caching: Smarty offers an optional feature for caching templates. Caching differs
from compilation, in that caching prevents the respective logic from even executing
instead of just rendering the cached contents. For example, you can designate a
time-to-live for cached documents of, say, five minutes, and during that time you
can forgo database queries pertinent to that template.
CHAPTER 19 ?– TEMPLAT ING WITH SMARTY 475
Highly configurable and extensible: Smarty??™s object-oriented architecture allows
you to modify and expand upon its default behavior. In addition, configurability
has been a design goal from the start, offering users great flexibility in customizing
Smarty??™s behavior through built-in methods and attributes.
Secure: Smarty offers a number of features to shield the server and the application
data from potential compromise by the designer, intended or otherwise.
Keep in mind that all popular templating solutions follow the same core set of implementation
principles.
Pages:
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556