多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### :-: **视图核心类** 引入Smarty ~~~php <?php namespace core; use Smarty\Smarty; use Smarty\SmartyException; class View { /** * 视图类 Smarty渲染显示 * @param $name string * @param $path string * @throws SmartyException */ public function smarty(string $name, string $path = '') { $smarty = new Smarty; $smarty->setTemplateDir(BASE_PATH . 'view/'); // 设置模板目录 $smarty->setCompileDir(BASE_PATH . 'runtime/smarty/compile/'); $smarty->setConfigDir(BASE_PATH . 'config/smarty/'); $smarty->setCacheDir(BASE_PATH . 'runtime/smarty/cache/'); $smarty->debugging = true; $smarty->assign($this->_assign ?: []); $smarty->display($this->_controller . '/' . $name . '.html'); } } ~~~