FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour CONTROLLER and ROUTER
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
CONTROLLER and ROUTER
Posted: Wed Nov 11, 2020 08:24 PM
Hello,

Now the router is working very efficiently:

There are 2 hash tables.
Code (fw): Select all Collapse
 hRouting[  "datakunden:edit" ] = "edit"
 hRouting[  "datakunden:brief" ] = "briefe"
... 
 hRouting[  "landingpage:edit" ] = "editbutton"
...
 hWebPageName[ "landingpage:edit" ] = "Setup Schalter Landing Page"
 hWebPageName[ "datakunden: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

Continue the discussion