forked from unusorin/php-xtemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex6.php
executable file
·41 lines (32 loc) · 1.27 KB
/
ex6.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* example 6
* demonstrates nullblocks
*
* @package XTemplate_Examples
* @author Barnabas Debreceni [[email protected]]
* @copyright Barnabas Debreceni 2000-2001
* @author Jeremy Coates [[email protected]]
* @copyright Jeremy Coates 2002-2007
* @see license.txt LGPL / BSD license
* @link $HeadURL: https://xtpl.svn.sourceforge.net/svnroot/xtpl/trunk/ex6.php $
* @version $Id: ex6.php 16 2007-01-11 03:02:49Z cocomp $
*/
include_once('./xtemplate.class.php');
$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.. set_null_block("block not parsed!") coming');
$xtpl->set_null_block('block not parsed!');
$xtpl->parse('main.block');
$xtpl->assign('INTRO_TEXT', "ok.. custom nullblocks.. set_null_block('subblock1 not parsed!', 'main.block.subblock1')");
$xtpl->set_null_block('block not parsed!');
$xtpl->set_null_block('subblock1 not parsed!', 'main.block.subblock1');
$xtpl->parse('main.block');
$xtpl->parse('main');
$xtpl->out('main');
?>