Skip to content

Commit

Permalink
welcome to vanilla
Browse files Browse the repository at this point in the history
  • Loading branch information
idevz committed Sep 17, 2015
1 parent 76e327b commit b6d957e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.*
<p><a href="http://idevz.github.io/vanilla/"><img border="0" src="http://m1.sinaimg.cn/maxwidth.300/m1.sinaimg.cn/ca65fa784406a36ba4fc41d14e21661e_1364_1494.png" alt="LuaRocks" width="150px"></a></p>

*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
##useage
```
vanilla new app
cd app
vanilla start
```
1 change: 0 additions & 1 deletion pretty/application/controllers/error.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ local ErrorController = {}

function ErrorController:error()
local view = self:getView()
ppz(self.err)
-- local p = {}
-- p['message'] = '====cc======'
-- p['status'] = '=====kk====='
Expand Down
6 changes: 2 additions & 4 deletions pretty/application/controllers/index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pretty/application/views/index/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<body>
<h1>{{message}}</h1>
<h1>{{kk}}</h1>
<img src="http://m1.sinaimg.cn/maxwidth.300/m1.sinaimg.cn/ca65fa784406a36ba4fc41d14e21661e_1364_1494.png">
<h1><a href = 'https://github.com/idevz/vanilla'>{{vanilla}}</a></h1><h5>{{zhoujing}}</h5>
</body>
</html>
12 changes: 4 additions & 8 deletions vanilla/sys/application.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -56,9 +53,8 @@ local index_tpl = [[
<!DOCTYPE html>
<html>
<body>
<h1>{{message}}</h1>
<h1>{{kk}}</h1>
<h5>{{zhou}}</h5>
<img src="http://m1.sinaimg.cn/maxwidth.300/m1.sinaimg.cn/ca65fa784406a36ba4fc41d14e21661e_1364_1494.png">
<h1><a href = 'https://github.com/idevz/vanilla'>{{vanilla}}</a></h1><h5>{{zhoujing}}</h5>
</body>
</html>
]]
Expand Down

0 comments on commit b6d957e

Please sign in to comment.