TemplateObject.object

Boundary Conditions

DOCUMENT STARTS
[-TOKEN1-]
%TOKEN2-]
[-TOKEN3%
%TOKEN4%
TOKEN5-]
[-TOKEN6
TOKEN7

DOCUMENT ENDS

  • Parse Template, register single token, with no value $template_obj = new TemplateObject(); $template_obj->Register('TOKEN1',''); $template_obj->ParseTemplate('TemplateObject.tmpl'); unset($template_obj);
  • DOCUMENT STARTS

    %TOKEN2-]
    [-TOKEN3%
    %TOKEN4%
    TOKEN5-]
    [-TOKEN6
    TOKEN7

    DOCUMENT ENDS

  • Parse Template, register single token, change start tag $template_obj = new TemplateObject(); $template_obj->template_var_start = '%'; $template_obj->Register('TOKEN2','***NEWVALUE***'); $template_obj->ParseTemplate('TemplateObject.tmpl'); unset($template_obj);
  • DOCUMENT STARTS
    [-TOKEN1-]
    ***NEWVALUE***
    [-TOKEN3%
    %TOKEN4%
    TOKEN5-]
    [-TOKEN6
    TOKEN7

    DOCUMENT ENDS

  • Parse Template, register single token, change end tag $template_obj = new TemplateObject(); $template_obj->template_var_end = '%'; $template_obj->Register('TOKEN3','***NEWVALUE***'); $template_obj->ParseTemplate('TemplateObject.tmpl'); unset($template_obj);
  • DOCUMENT STARTS
    [-TOKEN1-]
    %TOKEN2-]
    ***NEWVALUE***
    %TOKEN4%
    TOKEN5-]
    [-TOKEN6
    TOKEN7

    DOCUMENT ENDS

  • Parse Template, register single token, change both end and start tags $template_obj = new TemplateObject(); $template_obj->template_var_start = '%'; $template_obj->template_var_end = '%'; $template_obj->Register('TOKEN4','***NEWVALUE***'); $template_obj->ParseTemplate('TemplateObject.tmpl'); unset($template_obj);
  • DOCUMENT STARTS
    [-TOKEN1-]
    %TOKEN2-]
    [-TOKEN3%
    ***NEWVALUE***
    TOKEN5-]
    [-TOKEN6
    TOKEN7

    DOCUMENT ENDS

  • Parse Template, register single token, change start tag to NOTHING! $template_obj = new TemplateObject(); $template_obj->template_var_start = ''; $template_obj->Register('TOKEN5','***NEWVALUE***'); $template_obj->ParseTemplate('TemplateObject.tmpl'); unset($template_obj);
  • DOCUMENT STARTS
    [-TOKEN1-]
    %TOKEN2-]
    [-TOKEN3%
    %TOKEN4%
    ***NEWVALUE***
    [-TOKEN6
    TOKEN7

    DOCUMENT ENDS

  • Parse Template, register single token, change end tag to NOTHING! $template_obj = new TemplateObject(); $template_obj->template_var_end = ''; $template_obj->Register('TOKEN6','***NEWVALUE***'); $template_obj->ParseTemplate('TemplateObject.tmpl'); unset($template_obj);
  • DOCUMENT STARTS
    [-TOKEN1-]
    %TOKEN2-]
    [-TOKEN3%
    %TOKEN4%
    TOKEN5-]
    ***NEWVALUE***
    TOKEN7

    DOCUMENT ENDS

  • Parse Template, register single token, change end and start tags to NOTHING! $template_obj = new TemplateObject(); $template_obj->template_var_start = ''; $template_obj->template_var_end = ''; $template_obj->Register('TOKEN7','***NEWVALUE***'); $template_obj->ParseTemplate('TemplateObject.tmpl'); unset($template_obj);
  • DOCUMENT STARTS
    [-TOKEN1-]
    %TOKEN2-]
    [-TOKEN3%
    %TOKEN4%
    TOKEN5-]
    [-TOKEN6
    ***NEWVALUE***

    DOCUMENT ENDS

    Regular Conditions