Authored by hf

do add static path to save css js images resource

... ... @@ -18,6 +18,7 @@ README.md 可以添加一些访问资料的快捷方式(索引),可以是
| framework | 框架目录 | 存放框架代码,方便多个项目复用 |
| library | 核心库目录 | 存放业务核心代码,方便多个项目复用 |
| script | 脚本目录 | 存放业务相关的数据库表结构及服务器配置等 |
| static | 静态资源目录 | 存放css、js、图片等静态的资源 |
| template | 模板目录 | 存放前端的模板文件,由前端维护 |
| tests | 测试用例目录 | 存放测试用例文件 |
| yohobuy | 代码目录 | 存放后端业务相关的代码 |
... ...
... ... @@ -74,7 +74,7 @@ class TemplateLayout implements View_Interface
$config = Application::app()->getConfig()->get('application');
$tplExt = $config->template->ext;
$viewPath = $config->template->path;
$viewName = $viewPath . '/' . $request->module . '/' . $request->controller . '/' . $tpl . '.' . $tplExt;
$viewName = $viewPath . '/' . $request->module . '/' . $request->controller . '/' . $tpl . $tplExt;
// 判断视图模板文件是否存在, 不存在则直接返回空
if (!file_exists($viewName)) {
return '';
... ... @@ -102,7 +102,7 @@ class TemplateLayout implements View_Interface
// DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION
'flags' => LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式
'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录
'fileext' => array('.' . $tplExt), // 允许查找文件的后缀
'fileext' => array($tplExt), // 允许查找文件的后缀
'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime
));
// 文件流方式读取PHP方法
... ...
... ... @@ -44,4 +44,4 @@ application.dispatcher.catchException = True
application.template.compile = ROOT_PATH "/compile/m.yohobuy.com"
application.template.path = ROOT_PATH "/template/m.yohobuy.com/actions"
application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials"
application.template.ext = "phtml"
\ No newline at end of file
application.template.ext = ".phtml"
\ No newline at end of file
... ...
... ... @@ -44,4 +44,4 @@ application.dispatcher.catchException = False
application.template.compile = ROOT_PATH "/compile/m.yohobuy.com"
application.template.path = ROOT_PATH "/template/m.yohobuy.com/actions"
application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials"
application.template.ext = "phtml"
\ No newline at end of file
application.template.ext = ".phtml"
\ No newline at end of file
... ...
... ... @@ -44,4 +44,4 @@ application.dispatcher.catchException = True
application.template.compile = ROOT_PATH "/compile/m.yohobuy.com"
application.template.path = ROOT_PATH "/template/m.yohobuy.com/actions"
application.template.partials = ROOT_PATH "/template/m.yohobuy.com/partials"
application.template.ext = "phtml"
\ No newline at end of file
application.template.ext = ".phtml"
\ No newline at end of file
... ...