diff options
| author | uwetews <uwe.tews@googlemail.com> | 2018-08-12 03:20:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-12 03:20:33 +0200 |
| commit | b5e5085391100f26656276e091a0b8034e9f13c9 (patch) | |
| tree | 70c5d4d621d0b2ef394c7d13f445ad471b224da7 /libs/plugins/function.html_table.php | |
| parent | cc4d8fa1a07e18f00951a921041e37c87015dcb2 (diff) | |
| parent | 240409578349843bd8467ea6a2083b564baa135d (diff) | |
| download | smarty-b5e5085391100f26656276e091a0b8034e9f13c9.tar.gz smarty-b5e5085391100f26656276e091a0b8034e9f13c9.tar.bz2 smarty-b5e5085391100f26656276e091a0b8034e9f13c9.zip | |
Merge pull request #452 from dusta/Update-PSR-2
Update PSR-2
Diffstat (limited to 'libs/plugins/function.html_table.php')
| -rw-r--r-- | libs/plugins/function.html_table.php | 75 |
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; } } |
