Source for file ex6.php

Documentation is available at ex6.php

  1. <?php
  2.  
  3. /**
  4. * example 6
  5. * demonstrates nullblocks
  6. *
  7. * $Id: fsource_XTemplate__ex6.php.html,v 1.3 2005/04/11 10:00:49 cocomp Exp $
  8. */
  9.  
  10. include_once('./xtemplate.class.php');
  11.  
  12. $xtpl = new XTemplate('ex6.xtpl');
  13.  
  14. $xtpl->assign('INTRO_TEXT', "what happens if we don't parse the subblocks?");
  15. $xtpl->parse('main.block');
  16. $xtpl->assign('INTRO_TEXT', 'what happens if we parse them? :)');
  17. $xtpl->parse('main.block.subblock1');
  18. $xtpl->parse('main.block.subblock2');
  19. $xtpl->parse('main.block');
  20.  
  21. $xtpl->assign('INTRO_TEXT', 'ok.. SetNullBlock("block not parsed!") coming');
  22. $xtpl->SetNullBlock('block not parsed!');
  23. $xtpl->parse('main.block');
  24.  
  25. $xtpl->assign('INTRO_TEXT', "ok.. custom nullblocks.. SetNullBlock('subblock1 not parsed!', 'main.block.subblock1')");
  26. $xtpl->SetNullBlock('block not parsed!');
  27. $xtpl->SetNullBlock('subblock1 not parsed!', 'main.block.subblock1');
  28. $xtpl->parse('main.block');
  29.  
  30. $xtpl->parse('main');
  31. $xtpl->out('main');
  32.  
  33. /*
  34. $Log: fsource_XTemplate__ex6.php.html,v $
  35. Revision 1.3 2005/04/11 10:00:49 cocomp
  36. Added restart() method sf:641407 feature request
  37. Revision 1.2 2005/04/07 12:02:52 cocomp
  38. MAJOR UPDATE: E_ALL safe, better internal documentation, code readability ++, many bugfixes and new features - considered stable
  39. Revision 1.1 2001/07/11 10:49:25 cranx
  40. *** empty log message ***
  41. Revision 1.2 2001/03/26 23:25:02 cranx
  42. added keyword expansion to be more clear
  43. */
  44.  
  45. ?>

Documentation generated on Mon, 11 Apr 2005 10:59:10 +0100 by phpDocumentor 1.3.0RC3