CONTROLLER and ROUTER

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

CONTROLLER and ROUTER

Postby Otto » Wed Nov 11, 2020 8:24 pm

Hello,

Now the router is working very efficiently:

There are 2 hash tables.
Code: Select all  Expand view

 hRouting[  "datakunden:exec:edit" ] = "edit"
 hRouting[  "datakunden:exec:brief" ] = "briefe"
...
 hRouting[  "landingpage:exec:edit" ] = "editbutton"
...
 hWebPageName[ "landingpage:exec:edit" ] = "Setup Schalter Landing Page"
 hWebPageName[ "datakunden:exec:brief" ] = "QRCode Notes"
 hWebPageName[ "qrcode" ] = "QRCode Verwaltung"
 hWebPageName[ "landing" ] = "Langing Page Generator"

 

One for the ROUTE (hRouting) and one for the WebPageName (hWebPageName).
First the CONTROLLER checks whether the user is authorized and then forwards the request to the ROUTER.

In practice, only these two queries are required in the ROUTER:

cRoute: = hb_HGetDef (hRouting, hashkey, 'home')
cWebPageName: = hb_HGetDef (hWebPageName, hashkey, 'home')

return View( cRoute ) from ROUTER
then does the work.

I'm using the GENESIS example from mod harbour.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 6 guests