diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-07-04 15:28:29 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-07-04 15:28:29 +0000 |
commit | b69bd2531463dddd9ad0af32f589e594106a3b4f (patch) | |
tree | 2ec92a7258dc6796da3bb97887e4625a91fc7447 | |
parent | 0ec64b27143691be06918b6f0cdd3e70bc98b2dd (diff) | |
download | acf-sandbox-b69bd2531463dddd9ad0af32f589e594106a3b4f.tar.bz2 acf-sandbox-b69bd2531463dddd9ad0af32f589e594106a3b4f.tar.xz |
Added loadingdemo, a sample of how to load and access another controller from within your controller.
git-svn-id: svn://svn.alpinelinux.org/acf/sandbox/trunk@1277 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | loadingdemo-controller.lua | 10 | ||||
-rw-r--r-- | loadingdemo-read-html.lsp | 5 | ||||
-rw-r--r-- | loadingdemo.menu | 1 | ||||
-rw-r--r-- | loadingdemo.roles | 1 |
5 files changed, 22 insertions, 1 deletions
@@ -20,7 +20,11 @@ APP_DIST=\ prototypejsdemo-controller.lua \ prototypejsdemo-model.lua \ prototypejsdemo-html.lsp \ - prototypejsdemo.menu + prototypejsdemo.menu \ + loadingdemo-controller.lua \ + loadingdemo-read-html.lsp \ + loadingdemo.roles \ + loadingdemo.menu \ EXTRA_DIST=Makefile config.mk diff --git a/loadingdemo-controller.lua b/loadingdemo-controller.lua new file mode 100644 index 0000000..d259d2c --- /dev/null +++ b/loadingdemo-controller.lua @@ -0,0 +1,10 @@ +module(..., package.seeall) + +default_action = "read" + +function read(self) + local versioncontroller = self:new("alpine-baselayout/alpineversion") + local versionresult = versioncontroller:read() + versioncontroller:destroy() + return cfe({ value="I called alpineversion:read(), and you are running version "..versionresult.value, label="Alpine version" }) +end diff --git a/loadingdemo-read-html.lsp b/loadingdemo-read-html.lsp new file mode 100644 index 0000000..168a2c1 --- /dev/null +++ b/loadingdemo-read-html.lsp @@ -0,0 +1,5 @@ +<? data, viewlibrary, page_info, session = ... ?> + +<H1>Example of Loading Another Controller</H1> +I am <?= page_info.controller ?> / <?= page_info.action ?><br> +<?= data.value ?> diff --git a/loadingdemo.menu b/loadingdemo.menu new file mode 100644 index 0000000..c718a5c --- /dev/null +++ b/loadingdemo.menu @@ -0,0 +1 @@ +Test Loading_Demo Read read diff --git a/loadingdemo.roles b/loadingdemo.roles new file mode 100644 index 0000000..33a0663 --- /dev/null +++ b/loadingdemo.roles @@ -0,0 +1 @@ +ALL=loadingdemo:read |