From f253bc471f1051b74f966af1b941f766de61e31e Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Wed, 22 Aug 2018 19:56:56 +0200 Subject: [PATCH] examples --- apps/silk/Router.lua | 2 +- apps/views/admin/index.ls | 11 +++++++++ apps/views/{default => admin}/post/edit.ls | 0 apps/views/default/index.ls | 27 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 apps/views/admin/index.ls rename apps/views/{default => admin}/post/edit.ls (100%) create mode 100644 apps/views/default/index.ls diff --git a/apps/silk/Router.lua b/apps/silk/Router.lua index 45bbbe8..1bfaf2a 100644 --- a/apps/silk/Router.lua +++ b/apps/silk/Router.lua @@ -83,7 +83,7 @@ function Router:delegate() self:error(o) end else - self:error(e) + self:error("The index page is not found for layout: "..self.registry.layout) end end diff --git a/apps/views/admin/index.ls b/apps/views/admin/index.ls new file mode 100644 index 0000000..deaa5f6 --- /dev/null +++ b/apps/views/admin/index.ls @@ -0,0 +1,11 @@ +") + local views = args[1] + for k, v in pairs(views) do + echo(k.." -> ") + v:render() + echo("
") + end + --views.__main__:render() +?> \ No newline at end of file diff --git a/apps/views/default/post/edit.ls b/apps/views/admin/post/edit.ls similarity index 100% rename from apps/views/default/post/edit.ls rename to apps/views/admin/post/edit.ls diff --git a/apps/views/default/index.ls b/apps/views/default/index.ls new file mode 100644 index 0000000..ce19292 --- /dev/null +++ b/apps/views/default/index.ls @@ -0,0 +1,27 @@ + + + Application pages + + + +
+ ") + v:render() + echo("
") + end + --views.__main__:render() + ?> +
+ + \ No newline at end of file