<?
/*
example 6
demonstrates nullblocks
*/
require "xtpl.p";
$xtpl=new XTemplate ("ex6.xtpl");
$xtpl->assign(INTRO_TEXT,"what happens if we don't parse the subblocks?");
$xtpl->parse("main.block");
$xtpl->assign(INTRO_TEXT,"what happens if we parse them? :)");
$xtpl->parse("main.block.subblock1");
$xtpl->parse("main.block.subblock2");
$xtpl->parse("main.block");
$xtpl->assign(INTRO_TEXT,"ok.. SetNullBlock(\"block not parsed!\") coming");
$xtpl->SetNullBlock("block not parsed!");
$xtpl->parse("main.block");
$xtpl->assign(INTRO_TEXT,"ok.. custom nullblocks.. SetNullBlock(\"subblock1 not parsed!\",\"main.block.subblock1\")");
$xtpl->SetNullBlock("block not parsed!");
$xtpl->SetNullBlock("subblock1 not parsed!","main.block.subblock1");
$xtpl->parse("main.block");
$xtpl->parse("main");
$xtpl->out("main");
?>
|