Table of Contents

Core Import Tag

CORE:IMPORT

Import variable definitions into the current template scope

Syntax

    <core:import file="filename">

Description

The CoreImportTag is a SilentCompilerDirectiveTag and has no corresponding component.

Example

The PHP file:

<?php
require_once '../wact/framework/common.inc.php';
require_once WACT_ROOT . '/template/template.inc.php';
 
$tpl =& new Template('/theTemplate.html');
$tpl->display();
?>

The template file ‘theTemplate.html’:

<html>
<body>
<core:import file="variable-definitions.ini">
{greeting} - {key1}, {key2}
</body>
</html>

The “variable-definitions.ini” file: one key-value pair per line keys don’t start with a sign

key1 = value1
key2 = value2
greeting = hello world

the output:

hello world - value1, value2

note : filename is relative to the template in which the core:import tag is utilized