Chapter 12. Smarty Class Variables

Table of Contents

$template_dir
$compile_dir
$config_dir
$plugins_dir
$debugging
$debug_tpl
$debugging_ctrl
$auto_literal
$autoload_filters
$compile_check
$force_compile
$caching
$cache_id
$cache_dir
$cache_lifetime
$cache_handler_func
$cache_modified_check
$config_overwrite
$config_booleanize
$config_read_hidden
$config_fix_newlines
$default_template_handler_func
$php_handling
$trusted_dir
$left_delimiter
$right_delimiter
$compiler_class
$request_vars_order
$request_use_auto_globals
$compile_id
$use_sub_dirs
$default_modifiers
$default_resource_type

These are all of the available Smarty class variables. You can access them directly, or use the corresponding setter/getter methods.

Note

All class variables have magic setter/getter methods available. setter/getter methods are camelCaseFormat, unlike the variable itself. So for example, you can set and get the $smarty->template_dir variable with $smarty->setTemplateDir($dir) and $dir = $smarty->getTemplateDir() respectively.

Note

See Changing settings by template section for how to change Smarty class variables for individual templates.

$template_dir

This is the name of the default template directory. If you do not supply a resource type when including files, they will be found here. By default this is ./templates, meaning that Smarty will look for the templates/ directory in the same directory as the executing php script.

Technical Note

It is not recommended to put this directory under the web server document root.


www.fengfly.com