summaryrefslogtreecommitdiff
path: root/libs/plugins/function.html_table.php
diff options
context:
space:
mode:
authorSławomir Kaleta <slaszka@gmail.com>2018-06-12 09:58:15 +0200
committerSławomir Kaleta <slaszka@gmail.com>2018-06-12 09:58:15 +0200
commit240409578349843bd8467ea6a2083b564baa135d (patch)
tree70c5d4d621d0b2ef394c7d13f445ad471b224da7 /libs/plugins/function.html_table.php
parentcc4d8fa1a07e18f00951a921041e37c87015dcb2 (diff)
downloadsmarty-240409578349843bd8467ea6a2083b564baa135d.tar.gz
smarty-240409578349843bd8467ea6a2083b564baa135d.tar.bz2
smarty-240409578349843bd8467ea6a2083b564baa135d.zip
Update PSR-2
Diffstat (limited to 'libs/plugins/function.html_table.php')
-rw-r--r--libs/plugins/function.html_table.php75
1 files changed, 37 insertions, 38 deletions
diff --git a/libs/plugins/function.html_table.php b/libs/plugins/function.html_table.php
index d9a9fd69..acd53d17 100644
--- a/libs/plugins/function.html_table.php
+++ b/libs/plugins/function.html_table.php
@@ -35,12 +35,11 @@
* {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
* {table loop=$data cols="first,second,third" tr_attr=$colors}
*
- *
- * @author Monte Ohrt <monte at ohrt dot com>
- * @author credit to Messju Mohr <messju at lammfellpuschen dot de>
- * @author credit to boots <boots dot smarty at yahoo dot com>
- * @version 1.1
- * @link http://www.smarty.net/manual/en/language.function.html.table.php {html_table}
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credit to Messju Mohr <messju at lammfellpuschen dot de>
+ * @author credit to boots <boots dot smarty at yahoo dot com>
+ * @version 1.1
+ * @link http://www.smarty.net/manual/en/language.function.html.table.php {html_table}
* (Smarty online manual)
*
* @param array $params parameters
@@ -70,42 +69,42 @@ function smarty_function_html_table($params)
foreach ($params as $_key => $_value) {
switch ($_key) {
- case 'loop':
- $$_key = (array) $_value;
- break;
+ case 'loop':
+ $$_key = (array) $_value;
+ break;
- case 'cols':
- if (is_array($_value) && !empty($_value)) {
- $cols = $_value;
- $cols_count = count($_value);
- } elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) {
- $cols = explode(',', $_value);
- $cols_count = count($cols);
- } elseif (!empty($_value)) {
- $cols_count = (int) $_value;
- } else {
- $cols_count = $cols;
- }
- break;
+ case 'cols':
+ if (is_array($_value) && !empty($_value)) {
+ $cols = $_value;
+ $cols_count = count($_value);
+ } elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) {
+ $cols = explode(',', $_value);
+ $cols_count = count($cols);
+ } elseif (!empty($_value)) {
+ $cols_count = (int) $_value;
+ } else {
+ $cols_count = $cols;
+ }
+ break;
- case 'rows':
- $$_key = (int) $_value;
- break;
+ case 'rows':
+ $$_key = (int) $_value;
+ break;
- case 'table_attr':
- case 'trailpad':
- case 'hdir':
- case 'vdir':
- case 'inner':
- case 'caption':
- $$_key = (string) $_value;
- break;
+ case 'table_attr':
+ case 'trailpad':
+ case 'hdir':
+ case 'vdir':
+ case 'inner':
+ case 'caption':
+ $$_key = (string) $_value;
+ break;
- case 'tr_attr':
- case 'td_attr':
- case 'th_attr':
- $$_key = $_value;
- break;
+ case 'tr_attr':
+ case 'td_attr':
+ case 'th_attr':
+ $$_key = $_value;
+ break;
}
}