Get Smarty

Donate

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Buy cheap glasses from Cheapglasses123.com and save up to 80%.

Where to buy prescription glasses? EyewearCanada.com is your best choice!

Advertisement

Name

getTemplateDir() — return the directory where templates are stored

Description

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.

Comments
No comments for this page.

Advertisement