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

Advertisement

Name

setPluginsDir() — 设置插件目录

说明

Smarty setPluginsDir(string|array plugins_dir);

Example 14.46. setPluginsDir()


<?php

// 设置单个插件目录
$smarty->setPluginsDir('./plugins');

// 查看全部插件目录
var_dump($smarty->getPluginsDir());

// 批量设置插件目录
$smarty->setPluginsDir(array(
    './plugins',
    './plugins_2',
));

// 查看全部插件目录
var_dump($smarty->getPluginsDir());

// 方法连用
$smarty->setTemplateDir('./templates')
       ->setPluginsDir('./plugins')
       ->setCompileDir('./templates_c')
       ->setCacheDir('./cache');

?>

   

参见 getPluginsDir(), addPluginsDir()$plugins_dir.