|
JHP allows Jade code to be embedded directly into a web page. This manual covers the
ins and outs of how do do this.
Pages that contain JHP code have the extension .jhp instead of .html
or .htm. The JHP module will only process files that end in the .jhp
extension.
Using JHP you embed Jade code into a web page. The Jade code must be placed between
the <?jhp and ?> markers. You can have as many JHP blocks on
the same .jhp page as desired.
Example 1 (displays the current time to the browser):
<HTML><TITLE>An example JHP page</TITLE>
<BODY>
<B>The current time is:</B>
<?jhp
vars
now: TimeStamp;
begin
echo(now.String);
endif;
?><BR>
<BODY></HTML>
When the web server processes the .jhp file, it will extract the Jade code
between the <?jhp and ?> markers and Jade will execute that code.
The results that Jade returns will replace the Jade code in the .jhp file. This
means that the web browser never gets to see any Jade code, only the results of that code.
In the above example a special method was used to echo text from Jade back to the
web server. That method is echo(...). There are other special Jade methods, and
these are descibed in the next section.
|
|