Print

 

 

sdParse is a PHP class used to parse a text string looking for commands.  Each command found is replaced by the text returned by an associated callback function.  For example, the command "{sdMacros logoSmall left/}" might be replaced by the HTML code to generate a logo (go to sdMacros for examples like this, or to download sdMacros to see how an extension uses sdParse).

sdParse is free!  But, feel free to donate if you like it! 

 

Download sdParse here: download sdParse

 

The sdParse command syntax is analogous to XML:

Command Syntax:

{tag [arg1] [arg2] ...}value{/tag}

{tag [arg1] [arg2] .../}

sdParse was developed for use in Joomla extensions but is not limited to them.  It is currently used by both sdMacros and gCalMarkup.

The syntax of the handleTags() function is as follows:

Description:

string handleTags( string $text, string $delimiters, array $tags, callback $callbacks, mixed $callbackData, bool $tagsOnly )

Parameters:

Return Value:

 

This syntax of the callback functions is as follows:

Description:

string callbackFunction( array $commandArgs, string $commandValue, mixed $callbackData, array $command )

Parameters:

Return Value: