|
Biferno is also a "HTML-embedded" language.
Scripts can be written in pure Biferno language, but can also contain
HTML code segments between Biferno code blocks.
The Biferno code is always
delimited by special tags that allow separation from the rest of the code
(HTML or whatever).
The following tags can be used to delimit a Biferno script:
<?
// Biferno code
?>
<?biferno
// Biferno code
?>
|
The alternative opening tag <?biferno is necessary when integrating Biferno
and XML code, or when using certain HTML development tools that are compatible
with embedded scripting languages.
When a browser requests a Web page to the server, the page is analyzed by the
Biferno interpreter only if it has been stored on the server in a file with ".bfr"
extension. If this is not the case, the page is simply returned to the client as a standard HTML page with no further intervention.
After processing, a page containing pure HTML code is returned by the server.
This page contains none of the Biferno instructions contained in the original script.
This implies that we do not have to worry about the ability of the other party to read
the code that produces a certain result, which is an issue e.g. with JavaScript client
side scripts.
During page processing the Biferno interpreter executes only the text (code) delimited by
the <? and ?> tags, ignoring the rest of the text, which is
returned with the output page to the client
(nevertheless an exception to this behavior exists).
An example is:
<html>
<body>
<b>An example of Biferno code embedded in a HTML page</b>
<hr>
The current Biferno version is
<?
print(biferno.version) //Print Biferno version
?>
<hr>
</body>
</html>
The example above produces the following HTML output
<html>
<body>
<b> An example of Biferno code embedded in a HTML page</b>
<hr>
The current Biferno version is
1.6.0
<hr>
</body>
</html>
The Biferno code has been replaced by the result of its processing, which is the current
version of Biferno. This information has been obtained by calling
the biferno.version method and sending its result in output using the print function.
The HTML code generated by this mechanism produces the following result in the browser window:
An example of Biferno code embedded in a HTML page
The current Biferno version is 1.6.0
|
|