Set template directory
public setTemplateDir ( string | array $template_dir ) : Smarty | ||
$template_dir | string | array | directory(s) of template sources |
return | Smarty | current Smarty instance for chaining |
$smarty->setTemplateDir('/path/to/templates');
$smarty->setTemplateDir(array( 'main' => '/path/to/main/templates/', 'header' => '/path/to/header/templates/', 'footer' => '/path/to/footer/templates/' ));This code sets the template directory for different sections of the website - main, header, and footer. Smarty is available as a package library in PHP.
public setTemplateDir ( string | array $template_dir ) : Smarty | ||
$template_dir | string | array | directory(s) of template sources |
return | Smarty | current Smarty instance for chaining |