Class: atkStringParser
Source Location: /utils/class.atkstringparser.inc
Class atkStringParser
Method Summary
| array |
getAttributes() |
Same as getFields but if a relation is referenced using a dot only returns the attribute name before the dot. |
| void |
getFields() |
Get the [ ] Fields out of a String |
| void |
isComplete() |
Does the data contains everything needed to be parsed into the string? |
| String |
parse() |
Parse data into the string. |
Methods
atkStringParser atkStringParser(
string
$string
)
|
|
Create a new stringparser
Parameters:
|
string |
$string: |
The string to parse |
array getAllFieldsAsArray(
)
|
|
Get all fields from a string
Example: string: [firstname], [lastname] [city] would return array('[firstname]',', ','[lastname]',' ','[city]')
array getAllParsedFieldsAsArray(
array
$data, [boolean
$split_tags_and_fields = false]
)
|
|
Parse data into the string and return all fields as an array
Parameters:
|
array |
$data: |
|
|
boolean |
$split_tags_and_fields: |
return fields and separators separated in resultarray (separators are not used in query, so quotes aren't used) |
Same as getFields but if a relation is referenced using a dot only returns the attribute name before the dot.
API Tags:
| Return: | attributes used in template |
Get the [ ] Fields out of a String
void isComplete(
array
$data
)
|
|
Does the data contains everything needed to be parsed into the string?
Parameters:
String parse(
array
$data, [bool
$encode = false], [
$replaceUnknownFields = true], bool
$ignoreUnknownFields
)
|
|
Parse data into the string.
Parameters:
|
array |
$data: |
The data to parse in the string |
|
bool |
$encode: |
Wether or not to do a rawurlencode |
|
bool |
$ignoreUnknownFields: |
Replace unknown fields with an empty string, if set to false unknown fields will be left untouched. |
|
|
$replaceUnknownFields: |
|
API Tags:
| Return: | The parsed string |