$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.