Page 1 of 1

Understanding Genesis

Posted: Sat Nov 09, 2019 8:57 am
by Otto
Dear Antonio,

I am using Genesis as Template for my program.
I insert some comments inside code for Ruth and Iris.
May I ask you help. Would you be so kind to look if this is correct what I write:

Can you please check the description of controller

Function of controller()
returns the args provided to Apache by the client if any if not default "browse"
Controller checks access:
cookies
user login and
requested content
depending on the AP_Method() GET or POSTan action is called ( cAction )
-----------------------------------------------------------

Controller calls view
case AP_Method() == "GET"
AP_RPuts( View( "default" ) )
|- Sends a value, converted into a string, to the client. Returns the number of bytes sent or -1 if there is an error


-----------------------------------------------------------
next step - ROUTER

state: user is logged in and made a valid request
Router() is used inside <body> to route to the selected view

here the program is routed to view - the "route" is passed through: cRoute parameter
-----------------------------------------------------------
Best regards
Otto

Re: Understanding Genesis

Posted: Sat Nov 09, 2019 9:13 am
by Antonio Linares
Dear Otto,

Yes, it is correct.

From a Model - View - Controller point of view:

1. Controller: It is the intermediate between the users requests and the views and data.

2. View: It is in charge of building the user interface.

3. Model: It is in charge of managing the data.

Users requests <---> Controller <---> Data and Views

We have an example of this in the first seamap.prg that was published:
https://github.com/FiveTechSoft/mod_har ... seamap.prg

Re: Understanding Genesis

Posted: Sat Nov 09, 2019 1:09 pm
by Otto
Dear Antonio,
thank you.
I will try to make a flow diagram for better understanding.
GENESIS is a very useful and very clean template. All that is needed for business APP is included.
Thank you so much.
Best regards
Otto

Re: Understanding Genesis

Posted: Sun Nov 10, 2019 1:02 am
by Otto
Image