Authored by hf

do add static path to save css js images resource

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