What is Smarty?
Why use it?
Use Cases and Work Flow
Syntax Comparison
Template Inheritance
Best Practices
Crash Course
You may use the Smarty logo according to the trademark notice.
For sponsorship, advertising, news or other inquiries, contact us at:
getTemplateDir() — return the directory where templates are stored
string|array getTemplateDir(string key);
Example 14.30. getTemplateDir()
<?php // set some template directories $smarty->setTemplateDir(array( 'one' => './templates', 'two' => './templates_2', 'three' => './templates_3', )); // get all directories where templates are stored $template_dir = $smarty->getTemplateDir(); var_dump($template_dir); // array // get directory identified by key $template_dir = $smarty->getTemplateDir('one'); var_dump($template_dir); // string ?>
See also
setTemplateDir()
,
addTemplateDir()
and
$template_dir
.