mixed getToken(
string
$key, [bool
$ignoreCaseFolding = FALSE])
|
|
returns the token value for the given token.
note: if caseFolding is used, your given $key will be converted according to the setting. see param $ignoreCaseFolding.
Tags:
Parameters:
array getTokens(
[bool
$ignoreCaseFolding = FALSE])
|
|
returns all token values.
note: if caseFolding is used, your given $key will be converted according to the setting. see param $ignoreCaseFolding.
Tags:
Parameters:
void setTag(
string
$tag)
|
|
the object may be init with a tag by using this method or directly in the constructor.
using this method kills all old data from before. also params/settings you made/set before.
Tags:
Parameters:
void setTagType(
string
$tagType)
|
|
sets the tag type, eg 'table'.
makes use of the caseFolding setting.
Tags:
Parameters:
array __parseProperties(
mixed
$propertyString, [bool
$debug = FALSE], string
&$propertyString)
|
|
same as parseTag() but takes a tag string instead of a full tag.
example: "type=\"formelement\" type='formelement' type=formelement formelement>" instead of: "<bs type=\"formelement\" type='formelement' type=formelement formelement>"
Tags:
Parameters:
array __parseTag(
mixed
$tag, [bool
$debug = FALSE], string
&$tag)
|
|
takes a tag (something like <bs_form name="name" what="element"/>) and parses its properties into a hash.
example: $tag = <bs type="formelement" name="name" multiple value='sam's pizzaland'/> $return = parseTag($tag); //now $return = array('type'=>'formelement', 'name'=>'name', 'multiple'=>TRUE, 'value'=>"sam's pizzaland");
tag properties may look different. as in html, the following versions are allowed: <bs type="formelement" type='formelement' type=formelement formelement> So properties can stand alone or can have a value, and the value can be in single quotes, double quotes or none at all. If a prop stands alone, it is treated like 'property=true' (bool). Cause in the hash we cannot set an undefined value like NULL. We'd have to make something up like 'bs_unset' which i don't want to.
The characters documented in Bs_HtmlUtil->filterForHtml() need to be translated to their html equivalents, not escaped. thus the following writings are *not* allowed: <bs value="my name is \"tom\"" value='sam\' pizzaland'>
Not allowed, as in html, is the writing <bs value=hello world> because 'world' would be a single property and does not belong to the value=hello.
Please be a bit careful when you write your tags. Things to avoid:
- tags that use more than 1 line (cr/lf)
- < tag name = hello / > <tag name = hello> (note the extra spaces)
As you can see in the example above, html special chars (&something) are converted for you.
Tags:
Parameters: