eXtension Templates for PHP (XTP for short)

Connecting things together - X prologue

In order to connect HTML template (.phpx) with appropriate code every template file needs to have prologue where it is specified what class is responsible for handling template, as well as path to the source file where class can be found. In addition, if component is using other components you need to specify them here too. If template is very simple it may not need external class to handle it, and then you can leave prologue out. Here is one example of page prologue:

<@
    <option name="class" value="Navigation"/>
    <option name="source" value="navigation.php"/>
    <control tag="links" prefix="y" path="links.phpx"/>
@>

As you can see from example above template prologue starts with <@ and ends with @>. Between those two tags are normal xml tags with the following meaning:

Now we can see that previous example means:

« Previous
XTP basic organization
Next »
Sample component - HTML