PHP Classes

File: ex5.p

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of barnabás debreceni  >  XTemplate  >  ex5.p  >  Download  
File: ex5.p
Role: ???
Content type: text/plain
Description: example 5 (demonstrates SetNullString)
Class: XTemplate
Template engine for PHP
Author: By
Last change:
Date: 15 years ago
Size: 991 bytes


Class file image Download

		example 5
		demonstrates nullstrings

	require "xtpl.p";

	$xtpl=new XTemplate ("ex5.xtpl");

	$xtpl->assign(INTRO_TEXT,"by default, if some variables weren't assigned a value, they simply disappear from the parsed html:");	

	$xtpl->assign(INTRO_TEXT,"ok, now let's assign a nullstring:");	
	$xtpl->SetNullString("value not specified!");

	$xtpl->assign(INTRO_TEXT,"custom nullstring for a specific variable and default nullstring mixed:");	
	$xtpl->SetNullString("no value..");
	$xtpl->SetNullString("no email specified!",EMAIL);
	$xtpl->assign(INTRO_TEXT,"custom nullstring for every variable:) .. you should get it by now. :P");	
	$xtpl->SetNullString("no email specified",EMAIL);
	$xtpl->SetNullString("no name specified",FULLNAME);
	$xtpl->SetNullString("no income?",INCOME);