Skip to content

Commit b4a9961

Browse files
committed
Added data-filter-human_readable Vtpl filter
1 parent c6c9a3e commit b4a9961

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

system/vtpl/vtpl.php

+20-19
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,26 @@ class Vtpl {
9393

9494
private $variableFilters =
9595
[
96-
'capitalize' => 'ucfirst($$0)',
97-
'cdata' => 'CDATA_START . $$0. CDATA_END',
98-
'friendly_date' => 'Vvveb\friendlyDate($$0)',
99-
'truncate' => 'substr($$0, 0, $$1)',
100-
'truncate_words' => 'Vvveb\truncateWords($$0,$$1)',
101-
'replace' => 'str_replace($$1, $$2, $$0)',
102-
'uppercase' => 'strtoupper($$0)',
103-
'lowercase' => 'strtolower($$0)',
104-
'append' => '$$1 . $$0',
105-
'prepend' => '$$0 . $$1',
106-
'strip_html' => 'strip_tags($$0)',
107-
'strip_newlines' => 'str_replace("\n",\' \', $$0)',
108-
'mod' => ['tag', 'if (@++$_modc_@@__VTPL_rand()__@@ % (int)$$1 === (int)$$2) {', 'if (@++$_modc_@@__VTPL_rand()__@@ % (int)$$1 === (int)$$2) {'],
109-
'mod_class' => ['class', '<?php if (@++$_modc_@@__VTPL_rand()__@@ % (int)$$1 === (int)$$2) echo $$0;?>'],
110-
'conditional_class'=> ['class', '<?php if (@++$_modc_@@__VTPL_rand()__@@ % (int)$$1 === (int)$$2) echo $$0;?>'],
111-
'iteration_class' => ['class', '<?php if (@++$_iterc_@@__VTPL_rand()__@@ === (int)$$2) echo $$1;?>'],
112-
'number_format' => 'number_format($$0, $$1, $$2, $$3)',
113-
'only_decimals' => 'substr($$0, (($_strpos = strrpos($$0, \'.\')) !== false)?$_strpos + 1:-100, ($_strpos !== false)?10:false)',
114-
'without_decimals' => 'substr($$0, 0, strrpos($$0, \'.\'))',
96+
'capitalize' => 'ucfirst($$0)',
97+
'cdata' => 'CDATA_START . $$0. CDATA_END',
98+
'friendly_date' => 'Vvveb\friendlyDate($$0)',
99+
'human_readable' => 'Vvveb\humanReadable($$0)',
100+
'truncate' => 'substr($$0, 0, $$1)',
101+
'truncate_words' => 'Vvveb\truncateWords($$0,$$1)',
102+
'replace' => 'str_replace($$1, $$2, $$0)',
103+
'uppercase' => 'strtoupper($$0)',
104+
'lowercase' => 'strtolower($$0)',
105+
'append' => '$$1 . $$0',
106+
'prepend' => '$$0 . $$1',
107+
'strip_html' => 'strip_tags($$0)',
108+
'strip_newlines' => 'str_replace("\n",\' \', $$0)',
109+
'mod' => ['tag', 'if (@++$_modc_@@__VTPL_rand()__@@ % (int)$$1 === (int)$$2) {', 'if (@++$_modc_@@__VTPL_rand()__@@ % (int)$$1 === (int)$$2) {'],
110+
'mod_class' => ['class', '<?php if (@++$_modc_@@__VTPL_rand()__@@ % (int)$$1 === (int)$$2) echo $$0;?>'],
111+
'conditional_class' => ['class', '<?php if (@++$_modc_@@__VTPL_rand()__@@ % (int)$$1 === (int)$$2) echo $$0;?>'],
112+
'iteration_class' => ['class', '<?php if (@++$_iterc_@@__VTPL_rand()__@@ === (int)$$2) echo $$1;?>'],
113+
'number_format' => 'number_format($$0, $$1, $$2, $$3)',
114+
'only_decimals' => 'substr($$0, (($_strpos = strrpos($$0, \'.\')) !== false)?$_strpos + 1:-100, ($_strpos !== false)?10:false)',
115+
'without_decimals' => 'substr($$0, 0, strrpos($$0, \'.\'))',
115116
];
116117

117118
private $attributesIndex = 0;

0 commit comments

Comments
 (0)