Book Image

Smarty PHP Template Programming and Applications

By : Hasin Hayder, Joao Prado Maia, Lucian Gheorghe
Book Image

Smarty PHP Template Programming and Applications

By: Hasin Hayder, Joao Prado Maia, Lucian Gheorghe

Overview of this book

<p>Smarty is a templating engine for PHP. Designers who are used to working with HTML files can work with Smarty templates, which are HTML files with simple tags while programmers work with the underlying PHP code. The Smarty engine brings the code and templates together. The result of all this is that designers can concentrate on designing, programmers can concentrate on programming, and they don't need to get in each others way so much. Even if you are developing a site on your own, Smarty is a powerful way to make your code clearer to you and others, as well as easier to debug and modify later.</p>
Table of Contents (18 chapters)
Smarty PHP Template Programming and Applications
Credits
About the Authors
About the Reviewer
Preface
Index

Chapter 8. Built-in Smarty Variables and Methods

In order to understand Smarty variables and methods, let’s first look at the Smarty library. Being a programmer probably makes you wonder how the Smarty library was built. If we look in the Smarty libs folder we can see four files: Config_File.class.php, debug.tpl, Smarty.class.php, and Smarty_Compiler.class.php.

The Config_File.class.php file contains a class for reading Smarty configuration files from the config folder. It has four configuration variables that you can edit to suit your application. These are:

Configuration Variable

Application

var $overwrite = true;

Controls whether variables with the same name overwrite each other.

var $booleanize = true;

Controls whether config values of on/true/yes and off/false/no get converted to Boolean values automatically.

var $read_hidden = true;

Controls whether hidden config sections/vars are read from the file.

var $fix_newlines = true;

Controls whether or not to fix Mac or DOS formatted...