Authored by hf

do init template path struct

Showing 24 changed files with 59 additions and 62 deletions
<?php return function ($in, $debugopt = 1) {
$cx = array(
'flags' => array(
'jstrue' => false,
'jsobj' => false,
'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
'echo' => false,
'debug' => $debugopt,
),
'constants' => array(),
'helpers' => array(),
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
'scopes' => array(),
'sp_vars' => array('root' => $in),
'lcrun' => 'Plugin\LCRun3',
);
return ''.'<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</title>
<meta name="keywords" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('keywords')), ENT_QUOTES, 'UTF-8').'">
<meta name="description" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('description')), ENT_QUOTES, 'UTF-8').'">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
</head>
<body>'.'
This is a test '.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('test')), ENT_QUOTES, 'UTF-8').'
'.'</body>
</html>'.'';
}
?>
\ No newline at end of file
存放静态资源
\ No newline at end of file
... ...
{{>layout/header}}
This is a test {{test}}
{{>layout/footer}}
\ No newline at end of file
... ...
<?php
/**
* 错误错误控制器
*
* @name ErrorController
* @desc 错误控制器, 在发生未捕获的异常时刻被调用
* @see http://www.php.net/manual/en/yaf-dispatcher.catchexception.php
* @author liuziyang
*/
use Action\AbstractAction;
class ErrorController extends AbstractAction
{
public function indexAction($exception)
public function indexAction()
{
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
$this->_view->render('error');
}
public function errorAction($exception)
{
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
echo $exception->getMessage();
//$this->_view->render('error');
}
}
... ...
<?php
use Action\AbstractAction;
/**
* 逛首
* 搜索
*/
class LifestyleController extends AbstractAction
class SearchController extends AbstractAction
{
public function indexAction()
{
echo 'guang';
echo 'search';
}
}
\ No newline at end of file
... ...
<?php
use Action\AbstractAction;
/**
* 明星品牌和原创品牌
*/
class PlusstarController extends AbstractAction
{
/**
* 品牌列表页
*/
public function listAction()
{
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('list', array('test' => 'hello world'));
}
/**
* 品牌介绍页
*/
public function detailAction()
{
}
}
\ No newline at end of file
... ...
... ... @@ -3,8 +3,8 @@
application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;默认模块
application.modules = "Index"
;;模块配置
application.modules = "Index,Category,Channel,Guang,Passport,Product"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
... ...
... ... @@ -4,7 +4,7 @@ application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;默认模块
application.modules = "Index"
application.modules = "Index,Category,Channel,Guang,Passport,Product"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
... ...
... ... @@ -4,7 +4,7 @@ application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;默认模块
application.modules = "Index"
application.modules = "Index,Category,Channel,Guang,Passport,Product"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
... ...
; default
;routes.index.type = "rewrite"
;routes.index.match = "/(index|index.html)$"
;routes.index.route.module = Default
;routes.index.route.controller = Index
;routes.index.route.action = Index
routes.index.type = "rewrite"
routes.index.match = "/index.html$"
routes.index.route.module = Index
routes.index.route.controller = Index
routes.index.route.action = Index
; error
routes.notfound.type = "rewrite"
routes.notfound.match = "/error.html"
routes.notfound.route.module = Default
routes.notfound.match = "/error.html$"
routes.notfound.route.module = Index
routes.notfound.route.controller = Error
routes.notfound.route.action = notfound
\ No newline at end of file
routes.notfound.route.action = Index
\ No newline at end of file
... ...