我想在我的主应用程序中创建一个子文件夹,但仍然允许独立应用程序访问smarty框架。使用Smarty PHP并需要子系统(独立)
我已经创建了名为“admin”的子文件夹。但是我不知道是否需要将它包含在我的设置文件中。
<?php
require_once(SMARTY_DIR . 'Smarty.class.php');
class Smarty_EVENT extends Smarty {
function __construct()
{
// Class Constructor.
// These automatically get set with each new instance.
parent::__construct();
$this->setTemplateDir('templates/');
$this->setCompileDir('templates_c/');
$this->setConfigDir('configs/');
$this->setCacheDir('cache/');
$this->caching = Smarty::CACHING_LIFETIME_CURRENT;
$this->assign('app_name', 'EVENT');
}
}
?>
如果你是在子文件夹中,然后将'../'添加到您的路径中。所以像'../ smarty/Smarty.class.php'或'../'。 SMARTY_DIR .'Smarty.class.php' – Forien 2015-01-21 09:45:39
为什么使用文件夹而不是路线? (看看Slim框架,它与smarty很好地配合) – 2015-01-21 11:26:36