Authored by hf

do init template path

Showing 44 changed files with 126 additions and 22 deletions
@@ -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 . '/' . strtolower($request->module) . '/' . strtolower($request->controller) . '/' . $tpl . $tplExt;
78 // 判断视图模板文件是否存在, 不存在则直接返回空 78 // 判断视图模板文件是否存在, 不存在则直接返回空
79 if (!file_exists($viewName)) { 79 if (!file_exists($viewName)) {
80 return ''; 80 return '';
1 -E:\nginx\instsrv.exe NGINX E:\nginx\srvany.exe  
2 -regedit /s E:\nginx\nginx.reg  
  1 +D:\nginx\instsrv.exe NGINX D:\nginx\srvany.exe
  2 +regedit /s D:\nginx\nginx.reg
1 {{>layout/header}} 1 {{>layout/header}}
2 2
3 This is a test {{test}} 3 This is a test {{test}}
  4 +频道选择
4 5
5 {{>layout/footer}} 6 {{>layout/footer}}
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
1 <?php 1 <?php
2 use Action\AbstractAction; 2 use Action\AbstractAction;
3 /** 3 /**
4 - * 男生频道 4 + * 男生首页
5 */ 5 */
6 class BoysController extends AbstractAction 6 class BoysController extends AbstractAction
7 { 7 {
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 * @name ErrorController 3 * @name ErrorController
5 * @desc 错误控制器, 在发生未捕获的异常时刻被调用 4 * @desc 错误控制器, 在发生未捕获的异常时刻被调用
@@ -11,20 +10,12 @@ use Action\AbstractAction; @@ -11,20 +10,12 @@ use Action\AbstractAction;
11 class ErrorController extends AbstractAction 10 class ErrorController extends AbstractAction
12 { 11 {
13 12
14 - public function errorAction($exception)  
15 - {  
16 - header('HTTP/1.1 404 Not Found');  
17 - header('Status: 404 Not Found');  
18 -  
19 - exit();  
20 - }  
21 -  
22 - public function notFoundAction() 13 + public function indexAction($exception)
23 { 14 {
24 header('HTTP/1.1 404 Not Found'); 15 header('HTTP/1.1 404 Not Found');
25 header('Status: 404 Not Found'); 16 header('Status: 404 Not Found');
26 17
27 - exit(); 18 + $this->_view->render('error');
28 } 19 }
29 20
30 } 21 }
1 <?php 1 <?php
2 use Action\AbstractAction; 2 use Action\AbstractAction;
3 /** 3 /**
4 - * 女生频道 4 + * 女生首页
5 */ 5 */
6 class GirlsController extends AbstractAction 6 class GirlsController extends AbstractAction
7 { 7 {
1 <?php 1 <?php
2 use Action\AbstractAction; 2 use Action\AbstractAction;
3 /** 3 /**
4 - * 会员账单 4 + * 逛首页
5 */ 5 */
6 -class IndexController extends AbstractAction 6 +class LifestyleController extends AbstractAction
7 { 7 {
8 public function indexAction() 8 public function indexAction()
9 { 9 {
10 - echo 'hello world'; 10 + echo 'guang';
11 } 11 }
12 } 12 }
1 <?php 1 <?php
2 use Action\AbstractAction; 2 use Action\AbstractAction;
3 /** 3 /**
4 - * 潮童频道 4 + * 潮童首页
5 */ 5 */
6 class KidsController extends AbstractAction 6 class KidsController extends AbstractAction
7 { 7 {
1 <?php 1 <?php
2 use Action\AbstractAction; 2 use Action\AbstractAction;
3 /** 3 /**
4 - * 创意生活频道 4 + * 创意生活首页
5 */ 5 */
6 class LifestyleController extends AbstractAction 6 class LifestyleController extends AbstractAction
7 { 7 {
8 public function indexAction() 8 public function indexAction()
9 { 9 {
10 - echo 'lifestyle'; 10 + echo 'life style';
11 } 11 }
12 } 12 }
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +
  1 +<?php
  2 +
  3 +/*
  4 + * To change this license header, choose License Headers in Project Properties.
  5 + * To change this template file, choose Tools | Templates
  6 + * and open the template in the editor.
  7 + */
  8 +