[ Index ] |
|
Code source de SugarCRM 5.0.0beta1 |
1 <? 2 3 /* 4 example 5 5 demonstrates nullstrings 6 7 8 9 */ 10 11 require "xtpl.p"; 12 13 $xtpl=new XTemplate ("ex5.xtpl"); 14 15 $xtpl->assign(INTRO_TEXT,"by default, if some variables weren't assigned a value, they simply disappear from the parsed html:"); 16 $xtpl->parse("main.form"); 17 18 $xtpl->assign(INTRO_TEXT,"ok, now let's assign a nullstring:"); 19 $xtpl->SetNullString("value not specified!"); 20 $xtpl->parse("main.form"); 21 22 $xtpl->assign(INTRO_TEXT,"custom nullstring for a specific variable and default nullstring mixed:"); 23 $xtpl->SetNullString("no value.."); 24 $xtpl->SetNullString("no email specified!",EMAIL); 25 $xtpl->parse("main.form"); 26 27 $xtpl->assign(INTRO_TEXT,"custom nullstring for every variable:) .. you should get it by now. :P"); 28 $xtpl->SetNullString("no email specified",EMAIL); 29 $xtpl->SetNullString("no name specified",FULLNAME); 30 $xtpl->SetNullString("no income?",INCOME); 31 $xtpl->parse("main.form"); 32 33 $xtpl->parse("main"); 34 $xtpl->out("main"); 35 36 /* 37 38 Revision 1.1 2004/05/27 05:30:47 sugarjacob 39 Moving project to SourceForge. 40 41 Revision 1.1 2004/05/19 01:48:20 sugarcrm 42 Adding files with binary option as appropriate. 43 44 Revision 1.2 2001/03/26 23:25:02 cranx 45 added keyword expansion to be more clear 46 47 */ 48 49 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Sep 11 10:48:47 2007 | par Balluche grâce à PHPXref 0.7 |