SourceForge.net Logo                  

 

РУССКИЙ ENGLISH
Вернуться к оглавлению Back to Contents
Русская версия (скоро)
Advanced functions :

All advanced functions accept 4 parameters:

  1. String to be parsed or file name of the file to be parsed
  2. Namespace (by default is empty)
  3. Extra parameters, specific for each function
  4. Name of the global variable, keeping all parsing settings.
Result of each advanced function (if it has been called) replaced the callback tag where name  parameter is the same as function name. For instance,

<callback name=fileInclude> {tag inner} </callback> 

is replaced with result of fileInclude  function.
fileInclude()
Replaces the callback tag with the file content by given file name.
  <callback  {extra}  name=fileInclude    {extra}>
      file name 
  </callback>

where {extra} may contain one (or more) from the following parameters:
  • save=varname 
    If varname  is specified, the result of function will be also stored in global PHP variable with specified varname 
  • ffunc=funcname 
    If funcname  is specified and function with the name funcname  exists, then it's applied to file name , specified inside the callback tag.
  • func=funcname 
    If funcname  is specified and function with the name funcname  exists, then it's applied to the content of the file, defined by file name .
All extra-parameters are optional.
makeBool()
By given variable name, replaces the callback tag with the true-part    if specified variable is not empty, and with the false-part    otherwise.
  <callback  {extra}  name=makeBool    {extra}>
      { true-part  }
      { delimiter  }
      { false-part  }
  </callback>

where {extra} may contain one (or more) from the following parameters:
  • var=varname 
    If varname  is specified, it describes the name of variable to be checked for emptiness. Variable may be either global or namespace variable or constant. If varname  isn't specified, the function works the same way as variable would be empty.
  • save=varname 
    If varname  is specified, the result of function will be also stored in global PHP variable with specified varname 
  • type=invert 
    If type  is specified and is set to invert  then true-part  is selected when variable specified by var  parameter is empty and false-part  is selected when variable specified by var  parameter isn't empty; if type  is not specified or isn't set to invert  then true-part  is selected when variable specified by var  parameter isn't empty and false-part  is selected when variable specified by var  parameter is empty.
  • func=funcname 
    If funcname  is specified and function with the name funcname  exists, then it's applied to selected part of callback tag inner.
  • delim=delimiter 
    If delimiter  is specified it's used to separate the true-part  from false-part  inside of callback tag inner.
    If delimiter  isn't specified, default delimiter (|) is used.
All extra-parameters are optional.
makeArr()
Splits the callback tag inner onto the pieces, separated with delimiter and numerate them. Replaces callback tag with one of the pieces by given piece number.
Actually this function is enhanced case of makeBool() function.
Warning! Pieces numeration is started from 0(zero).
  <callback  {extra}  name=makeArr    {extra}>
      { 1 st piece  }
      { delimiter  }
      { 2 nd piece  }
      { delimiter  }
      ...
      { delimiter  }
      { N th piece  }
  </callback>

where {extra} may contain one (or more) from the following parameters:
  • key=varname 
    If varname  is specified, it describes the piece number, otherwise key  is considered as equal to 0(zero). If key  is invalid (there is no such piece number), then the empty string is used to replace callback tag.
  • save=varname 
    If varname  is specified, the result of function will be also stored in global PHP variable with specified varname 
  • func=funcname 
    If funcname  is specified and function with the name funcname  exists, then it's applied to selected piece of callback tag inner.
  • delim=delimiter 
    If delimiter  is specified it's used to separate the true-part  from false-part  inside of callback tag inner.
    If delimiter  isn't specified, default delimiter (|) is used.
All extra-parameters are optional.
makeRepeat()
Gets the name of variable, containing the source array. For each element of that array, given string is parsed and the result is added to pre-defined result string. Callback tag is replaced with the obtained result string.
  <callback  {extra}  name=makeRepeat    {extra}>
      { tag inner }
  </callback>

where {extra} may contain one (or more) from the following parameters:
  • arr=varname 
    If varname  is specified, it describes the name of array to be passed. Array may be either global or namespace variable or constant.
  • save=varname 
    If varname  is specified, the result of function will be also stored in global PHP variable with specified varname 
  • func=funcname 
    If funcname  is specified and function with the name funcname  exists, then it's applied to callback tag inner.
All extra-parameters are optional.