diff options
author | Nathan Angelacos <nangel@tetrasec.net> | 2008-07-05 15:12:02 +0000 |
---|---|---|
committer | Nathan Angelacos <nangel@tetrasec.net> | 2008-07-05 15:12:02 +0000 |
commit | 8b2e668680ca182d6a4f08daa90efe6dcb72d66f (patch) | |
tree | 2068b34cf17a7289e8e13aab18a97153682c0403 /loadingdemo-controller.lua | |
parent | b69bd2531463dddd9ad0af32f589e594106a3b4f (diff) | |
download | acf-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
Diffstat (limited to 'loadingdemo-controller.lua')
-rw-r--r-- | loadingdemo-controller.lua | 9 |
1 files changed, 8 insertions, 1 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 |