From b6d957e6648769138b652af73330fdeb89e3d34e Mon Sep 17 00:00:00 2001 From: idevz <15134559390@163.com> Date: Thu, 17 Sep 2015 15:51:53 +0800 Subject: [PATCH] welcome to vanilla --- README.md | 21 +++++++++++++++++---- pretty/application/controllers/error.lua | 1 - pretty/application/controllers/index.lua | 6 ++---- pretty/application/views/index/index.html | 4 ++-- vanilla/sys/application.lua | 12 ++++-------- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 5481597..069f5cf 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,22 @@ #vanilla ### One bouquet of vanilla -*what's vanilla? It's An Opentresty Web Framework For PHPER.* +*Vanilla is An Opentresty Web Framework For PHPER.* +

LuaRocks

-*Just like a vanilla* +##install +``` +yum install lua-devel luarocks +luarocks install https://raw.githubusercontent.com/idevz/vanilla/master/vanilla-0.0.1-1.rockspec +``` -> content_by_lua 'require(\"pub.index\")'; +##set +``` +content_by_lua_file ./pub/index.lua; +``` -yum install lua-devel \ No newline at end of file +##useage +``` +vanilla new app +cd app +vanilla start +``` \ No newline at end of file diff --git a/pretty/application/controllers/error.lua b/pretty/application/controllers/error.lua index b85686a..16a42dd 100755 --- a/pretty/application/controllers/error.lua +++ b/pretty/application/controllers/error.lua @@ -3,7 +3,6 @@ local ErrorController = {} function ErrorController:error() local view = self:getView() - ppz(self.err) -- local p = {} -- p['message'] = '====cc======' -- p['status'] = '=====kk=====' diff --git a/pretty/application/controllers/index.lua b/pretty/application/controllers/index.lua index e6ff1e6..b1f53c7 100755 --- a/pretty/application/controllers/index.lua +++ b/pretty/application/controllers/index.lua @@ -2,12 +2,10 @@ local IndexController = {} function IndexController:index() local view = self:getView() - local req = self:getRequest() local p = {} - p['message'] = 'K' - p['kk'] = tservice:get() + p['vanilla'] = 'Welcome To Vanilla...' + p['zhoujing'] = 'Power by Openresty' view:assign(p) - view:assign('zhou', 'jing') return view:display() end diff --git a/pretty/application/views/index/index.html b/pretty/application/views/index/index.html index a136169..877afbb 100755 --- a/pretty/application/views/index/index.html +++ b/pretty/application/views/index/index.html @@ -1,7 +1,7 @@ -

{{message}}

-

{{kk}}

+ +

{{vanilla}}

{{zhoujing}}
\ No newline at end of file diff --git a/vanilla/sys/application.lua b/vanilla/sys/application.lua index f9495ba..a134a8b 100755 --- a/vanilla/sys/application.lua +++ b/vanilla/sys/application.lua @@ -38,14 +38,11 @@ local IndexController = {} function IndexController:index() local view = self:getView() - local req = self:getRequest() local p = {} - p['message'] = 'K' - p['kk'] = tservice:get() + p['vanilla'] = 'Welcome To Vanilla...' + p['zhoujing'] = 'Power by Openresty' view:assign(p) - view:assign('zhou', 'jing') return view:display() - -- return view:render('t/aa.html', p) end return IndexController @@ -56,9 +53,8 @@ local index_tpl = [[ -

{{message}}

-

{{kk}}

-
{{zhou}}
+ +

{{vanilla}}

{{zhoujing}}
]]