Mail archive
acf

[Acf] Calling for another model/controller

From: Mika Havela <mika.havela_at_gmail.com>
Date: Wed, 5 Mar 2008 11:16:49 +0100

Hi!
I'm having problems with calling another model/controller to get some
information.
I have tried to call for hostname information, and that works just fine!

This works:
        local m, w_loaded, m_loaded = self:new("alpine-baselayout/hostname")
        local output = m.worker.read(m)
        return { output=output, }
I get the hostname in return.
When doing this... it doesn't work (which it probably shouldn't):
        local m, w_loaded, m_loaded = APP:new("alpine-baselayout/hostname")


Now I would like to have a list of interfaces (provided by the
alpine-baselayout/interfaces-[model|controller]).
So I try to:
        local m, w_loaded, m_loaded = APP:new("alpine-baselayout/interfaces")
        local output = m.worker.read(m)
        return { output=output, }

or
        local m, w_loaded, m_loaded = self:new("alpine-baselayout/interfaces")
        local output = m.worker.read(m)
        return { output=output, }

But when I do this... my page is automatically redirected to the
'default page' for my app (in my case im redirected to 'status'-page).
So I don't get any information from the model (or maybe I do, but my
view is changed so I don't se the result).

I have tried to call the interfaces-model instead... but it acts the same way.

Any suggestions on how I can get information from the
alpine-baselayout/interfaces and use this information in another
controller (or even another model).

<<mika>>
Received on Wed Mar 05 2008 - 11:16:49 GMT