),
'php' => array(
-# NB 27.09.16 'enclose' => [
-# NB 27.09.16 '<?php'.(NB_EOL ? NB_EOL:' ') . '$VAR = array('.NB_EOL
-# NB 27.09.16 ,NB_EOL.');' . (NB_EOL ? NB_EOL:' ').'?'.'>'.NB_EOL
-# NB 27.09.16 ],
'enclose' => (self::p('enclose') === '0' ? [] : [
'<?php'.(NB_EOL ? NB_EOL:' ') . '$VAR = array('
,');' . (NB_EOL ? NB_EOL:' ').'?'.'>'.NB_EOL
'eol' => self::p('eol',NB_EOL),
'rec' => ',',
'row' => function(&$o,&$r) {
-#bye($o['var_export']);
-/*
- if (!empty($o['var_export'])) {
- if (empty($_GLOBAL['ROWS'])) {
- $_GLOBAL['ROWS'] = [];
- $o['rec'] = '';
- }
- $_GLOBAL['ROWS'][] = $r;
- return;
- }
- */
return var_export($r);
echo preg_replace(array(
'/(=>\s*)\n\s+/m',
),var_export($r,true));
}
),
- 'php_var_dump' => array( 'row' => function(&$o,&$r) {var_dump($r);},),
- 'php_print_r' => array( 'row' => function(&$o,&$r) {print_r($r);},),
- 'php_var_export' => array( 'row' => function(&$o,&$r) {var_export($r);},),
+ 'php_var_dump' => ['row' => function(&$o,&$r) {var_dump($r);},],
+ 'php_print_r' => ['row' => function(&$o,&$r) {print_r($r);},],
+ 'php_var_export' => ['row' => function(&$o,&$r) {var_export($r);},],
'div' => array(
'is_html' => true,
'quote' => self::p('quote',''),
'quote_escape' => self::punescape('quote_escape','\\'),
'eol' => self::punescape('eol',"\n"),
-# NB 17.10.16 'enclose' => ["","\n"],
),
'yaml' => [
],
'json' => array(
- #'enclose' => array('['.NB_EOL,NB_EOL.']'),
'enclose' => array('['.self::p('eol',NB_EOL),']'),
'row' => function(&$o,&$row) { return json_encode($row); },
'eol' => self::p('eol',NB_EOL),
# Assume html/xml tag style
} elseif (isset($o['tag'])) {
$ret = out_tag($o,$row);
- } else {
+ } else {
# txt
$ret = self::row_txt($o,$row);
+
}
if (isset($o['eol'])) echo $o['eol'];
#bye('zaza');
static $is_html = null;
if ($is_html === null) $is_html = preg_match('/ml$/',self::content_type()) ? true : false;
+ #bye((int)$is_html);
# Extract attrs from tag
if (preg_match('/^([\w-]+)\s+(.*?)$/',$tag,$m)) {
# NB 28.11.16: Proper Markdown yould be great !
#if (!$is_html) return (preg_match('/^(span|a|inline|label|input|select)$/',strtolower($tag))?"":"\n").join("\n",(array)$content);
// Markdonw to html
+ if (!$is_html) return join("\n",(array)$content);
+ /*
if (!$is_html) return join("\n",array_map(function($e) use($tag){
if (preg_match('/^(li|dd)$/',$tag)) {
;
},(array)$content));
+ */
if ($content===null) {
self::tag_end($tag);