summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Angelacos <nangel@tetrasec.net>2008-07-05 15:12:02 +0000
committerNathan Angelacos <nangel@tetrasec.net>2008-07-05 15:12:02 +0000
commit8b2e668680ca182d6a4f08daa90efe6dcb72d66f (patch)
tree2068b34cf17a7289e8e13aab18a97153682c0403
parentb69bd2531463dddd9ad0af32f589e594106a3b4f (diff)
downloadacf-sandbox-8b2e668680ca182d6a4f08daa90efe6dcb72d66f.tar.bz2
acf-sandbox-8b2e668680ca182d6a4f08daa90efe6dcb72d66f.tar.xz
Demo calling a sub controller's model functions directly
git-svn-id: svn://svn.alpinelinux.org/acf/sandbox/trunk@1283 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--loadingdemo-controller.lua9
-rw-r--r--loadingdemo-read-html.lsp10
2 files changed, 17 insertions, 2 deletions
diff --git a/loadingdemo-controller.lua b/loadingdemo-controller.lua
index d259d2c..817196a 100644
--- a/loadingdemo-controller.lua
+++ b/loadingdemo-controller.lua
@@ -5,6 +5,13 @@ default_action = "read"
function read(self)
local versioncontroller = self:new("alpine-baselayout/alpineversion")
local versionresult = versioncontroller:read()
+
+ -- Here's how you call the model directly
+ local modelresult = versioncontroller.model:get()
+
versioncontroller:destroy()
- return cfe({ value="I called alpineversion:read(), and you are running version "..versionresult.value, label="Alpine version" })
+
+ return cfe({ controller="I called alpineversion:read(), and you are running version "..versionresult.value,
+ model="The model call to get() returned " .. modelresult.value
+ })
end
diff --git a/loadingdemo-read-html.lsp b/loadingdemo-read-html.lsp
index 168a2c1..4890b40 100644
--- a/loadingdemo-read-html.lsp
+++ b/loadingdemo-read-html.lsp
@@ -2,4 +2,12 @@
<H1>Example of Loading Another Controller</H1>
I am <?= page_info.controller ?> / <?= page_info.action ?><br>
-<?= data.value ?>
+
+<h2>SubController Result</h2>
+
+<?= data.controller ?>
+
+<h2>SubController - MODEL - Result</h2>
+
+
+<?= data.model ?>