$title = "Code Transformations While Parsing"; [ESITE BEGIN]
When parsing documents and templates, eSite performs 3 possible kinds of code transformations on the documents before parsing any instructions in the documents.
If an eSite document does not begin with <?esite
and end with ?>
statements, these statements are added to the document., along with a statement tying the document to the default template using a PHP require
statement. If the document author wishes to use a template other than the default for a particular document, he may write the complete code to use the template himself.
eSite provides a set of statements in the form [--ESITE SOME STATEMENT]
that are transformed into PHP code inside <?esite ?>
tags during the second transformation. The purpose of these statements is to cover code that is required for parsing, but which does not contribute to any logic of the template or document. The allowed bracketed statements are outlined below:
$esite_document_content = <<<END_OF_CONTENT
[--ESITE BEGIN]
discussed above. It is replaced with the following code on a line by itself:END_OF_CONTENT;
[--ESITE BEGIN]
and [--ESITE END]
bracketed statements; it is only meaningful in a template. It is replaced with the following code:<?esite esite_parse_document_content($esite_document_content); ?>
Code to be parsed by eSite is, once the above transformations have been completed, enclosed in <?esite ?>
tags. PHP calmly ignores all code not in <?php ?>
tags, so the following transformations are done: <?php
is changed to <?esite-php
and <?esite
is changed to <?php
. Once the parsing is completed, this step is undone, leaving a valid PHP document, if the original documents or templates contained any code wrapped in <?php ?>
tags.