Troubleshooting revIgniter library functions
Andre Alves Garzia
andre at andregarzia.com
Fri Nov 30 05:02:55 EST 2018
Keith,
RevIgniter is a normal LiveCode collection of libraries. Have you read
the getting started guide at:
https://revigniter.com/userGuide/overview/getting_started.html
It will walk you through the concepts of MVC and how they are used in
RevIgniter. Basically your models are the stuff that touch data, views
are the templates that are shown to the user and controllers are where
the business logic is. You can also have libraries. So if your DocLogin
has a function that returns a token, you can call it from a model or a
controller and get the value.
There is really no "1 minute explanation" that will clear it all,
RevIgniter is quite easy and consistent but it requires you to go over
its documentation at least once. Some URLs of interest are:
https://revigniter.com/userGuide/overview/appflow.html
https://revigniter.com/userGuide/tutorials/chat.html
I recommend doing the tutorial a lot.
Cheers
andre
On 30/11/2018 09:32, Keith Clarke via use-livecode wrote:
> Folks,
> I’m struggling to get my head around revIgniter / MVC concepts and map basic LC desktop concepts to the right places in LCS + revIgniter. (I’m still searching for a 'Rosetta Stone’ to translate between these two worlds!)
>
> My use case is to share public FAQs from specific pages designated as public in our knowledge base. I have a basic LC desktop prototype that I’m migrating to LCS + revIgniter. The desktop stack includes a single function stack script that logs into the KB server as a proxy ‘public user' and returns an access token string for subsequent page requests.
>
> To migrate this across to the server environment, I have simply transferred the stack script into a DocLogin.lc library file, replacing the final 'return “token”’ with put tToken into gData[“doc_token”] I may have misunderstood the revIgniter docs that this is the way to get the data ‘back’ to the controller, rather than use the desktop-style function do & return to a library (or stack) file?
>
> A DocLogin.lc controller file then attempts to call the above library and open a view file to check that the token is available via [[gData[“doc_token"] ]]
>
> The controller is opening the view but the token merge field is not shown and adding the generic rigShowError “message” alerts that the library couldn’t be loaded.
>
> I’d appreciate a steer as I’ve a feeling my approach here is fundamentally wrong for the LCS + revIgniter way of working.
> Thanks
> Keith
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list