Dear Antonio,
where do we find information about "views" and structured programming applied
to HTML.
Are there rules how to format the source code.
Thank you in advance
Otto
web programming
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 24 times
- Been thanked: 2 times
- Contact:
web programming
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 76 times
- Contact:
Re: web programming
Dear Otto,
This is the basic structure for a HTML page:
<html>
<head>
</head>
<body>
</body>
</html>
So our default.view using mod_harbour is going to be:
default.view
As mod_harbour is able to build "nested" views, now we need to define head.view and body.view
head.view
body.view
From mod_harbour we do:
View( "default" )
And mod_harbour will put all the parts together. Now lets say we want to have a menu and a browse:
body.view
Now we create a menu.view and a browse.view
This way all the complexity of a HTML page (lots of tags, very easy to make a mistake) is structured in small and easy to manage views
This is the beauty and the power of using mod_harbour Views engine
This is the basic structure for a HTML page:
<html>
<head>
</head>
<body>
</body>
</html>
So our default.view using mod_harbour is going to be:
default.view
Code: Select all | Expand
{{View("head")}}
{{View("body")}}
As mod_harbour is able to build "nested" views, now we need to define head.view and body.view
head.view
Code: Select all | Expand
<html>
<head>
</head>
body.view
Code: Select all | Expand
<body>
</body>
</html>
From mod_harbour we do:
View( "default" )
And mod_harbour will put all the parts together. Now lets say we want to have a menu and a browse:
body.view
Code: Select all | Expand
<body>
{{View("menu")}}
{{View("browse")}}
</body>
</html>
Now we create a menu.view and a browse.view
This way all the complexity of a HTML page (lots of tags, very easy to make a mistake) is structured in small and easy to manage views
This is the beauty and the power of using mod_harbour Views engine

Re: web programming
Hi Antonio ,
I know little bit JSP how it works in the JSP we can AJAX to call URL and the web server execute the relevant code for the given URL.
How we can co-relate the functionality int he mod_harbour ? Could you please provide some examples ?
Thanks
Shridhar
I know little bit JSP how it works in the JSP we can AJAX to call URL and the web server execute the relevant code for the given URL.
How we can co-relate the functionality int he mod_harbour ? Could you please provide some examples ?
Thanks
Shridhar
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 24 times
- Been thanked: 2 times
- Contact:
Re: web programming
Dear Antonio,
would you be so kind to post the source code corresponding to the description too.
I mean the folder containing the files.
Do we call this project?
Best regards
Otto
would you be so kind to post the source code corresponding to the description too.
I mean the folder containing the files.
Do we call this project?
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 24 times
- Been thanked: 2 times
- Contact:
Re: web programming
Dear Antonio,
{{View("browse")}}
is this the same as
include('browse.view')
Best regards
Otto
{{View("browse")}}
is this the same as
include('browse.view')
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
- Antonio Linares
- Site Admin
- Posts: 42521
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 76 times
- Contact:
Re: web programming
Otto,
function View() is a very powerful engine to manage views "recursively". It is not the same as include.
This function will become part of mod_harbour soon... (once we decide if "/views/" should be a parameter also, and if "view" should be hardcoded or not...)
function View() is a very powerful engine to manage views "recursively". It is not the same as include.
This function will become part of mod_harbour soon... (once we decide if "/views/" should be a parameter also, and if "view" should be hardcoded or not...)
Code: Select all | Expand
function View( cName )
local cData
if File( hb_GetEnv( "PRGPATH" ) + "/views/" + cName + ".view" )
cData = MemoRead( hb_GetEnv( "PRGPATH" ) + "/views/" + cName + ".view" )
while ReplaceBlocks( @cData, "{{", "}}" )
end
else
cData = "<h2>" + cName + " not found!</h2>"
endif
return cData
- Silvio.Falconi
- Posts: 7136
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: web programming
Antonio,
could you please continue the lesson for us from this tread?
could you please continue the lesson for us from this tread?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 24 times
- Been thanked: 2 times
- Contact:
Re: web programming
Dear Antonio,
I see on TWeb that we can have
<%prg
return Harbour code
%>
in views.
Is this withour TView class possible.
Best regards
Otto
I see on TWeb that we can have
<%prg
return Harbour code
%>
in views.
Is this withour TView class possible.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************