function patterns_parser_dump_comment in Patterns 7
Same name and namespace in other branches
- 7.2 includes/parser/parser.inc \patterns_parser_dump_comment()
Tries to dump an array representing a pattern to a string, according to the specified format.
If succesfull returns the array representation of the pattern, if not returns FALSE;
Parameters
mixed $pattern A string representation of the pattern, or a pattern: array. In the latter case, the array is returned as it is, and the @param $format is ignored.
mixed $format The format against which parse the pattern string.:
mixed $append (optional) A string to which the dump will be: appended. Defaults NULL
Return value
bool|mixed The string representation of the pattern or FALSE.
1 call to patterns_parser_dump_comment()
- patterns_lab_submit in includes/
forms/ lab.inc - Exports selected patterns either in a file or as a zip-archive
File
- includes/
parser/ parser.inc, line 209
Code
function patterns_parser_dump_comment($text, $format = PATTERNS_FORMAT_UNKNOWN, $append = NULL) {
if (empty($text)) {
return FALSE;
}
$dump_function = patterns_parser_get_parser_function($format, PATTERNS_PARSER_DUMP_COMMENT);
if (!$dump_function) {
return FALSE;
}
return $dump_function($text, $append);
}