InterJinn

Development Framework For PHP

Tag: <jinn:file/>

Abstract

You can load an external file into the current content where this tag is placed. The contents of the included file will be processed for any tags or embeds.

Attribute - path

Set this attribute to the location of the file for which the contents should be included. If the file path begins with // then the file path will be considered relative to the compileFilePath that you set in the project configuration. If the path is preceded by / then the file will be retrieved relative to the root of the filesystem. Last, if neither of the former two cases are true then the path will be treated as being relative to the last nested source file path. You should make sure that read permission is set for the appropriate owners at this location.

The recent addition of the Content Manager Service has added the option to load content via any number of different methods. To specify the exact method you must use the following styles for your path:

Examples:
file:////mainLayout.template
sql:///templates/main.template

There are three parts to the examples and specifically for the first example: the type specifier file, the separator ://, and the path //mainLayout.template. If you do not specify the type portion of the path, then the value configured in the $GLOBALS['interJinn']['contentDefaultType'] property will be used to determine the type. If this property has not been set then file is assumed.

It's useful to note that the functionality of the <jinn:file/>, <jinn:template/>, and <jinn:source/> tags are pretty much the same except that the base directory differs when using the relative prefix. The reason for this redundancy is mostly to create a separation of purpose and subsequently adding clarity to the content.

Example:
<jinn:file path="/etc/php.ini"/>