diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-05-17 13:32:19 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-05-17 13:32:19 +0200 |
commit | 5645479c622eb36cf9869797896dc0921568c4a9 (patch) | |
tree | 7a1d0c2d4cb38f440fcc7ff1204d527ed96477cc /system/libraries/Parser.php | |
parent | 92ebfb65ac044f5c2e6d88fba137253854cf1b94 (diff) |
Clean up the libraries
Diffstat (limited to 'system/libraries/Parser.php')
-rw-r--r-- | system/libraries/Parser.php | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index c40f339b4..a0b60ed97 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -42,14 +42,14 @@ class CI_Parser { * @var string */ public $l_delim = '{'; - + /** * Right delimeter character for psuedo vars * * @var string */ public $r_delim = '}'; - + /** * Reference to CodeIgniter instance * @@ -116,14 +116,9 @@ class CI_Parser { foreach ($data as $key => $val) { - if (is_array($val)) - { - $template = $this->_parse_pair($key, $val, $template); - } - else - { - $template = $this->_parse_single($key, (string)$val, $template); - } + $template = is_array($val) + ? $this->_parse_pair($key, $val, $template) + : $template = $this->_parse_single($key, (string) $val, $template); } if ($return == FALSE) @@ -189,14 +184,9 @@ class CI_Parser { $temp = $match[1]; foreach ($row as $key => $val) { - if ( ! is_array($val)) - { - $temp = $this->_parse_single($key, $val, $temp); - } - else - { - $temp = $this->_parse_pair($key, $val, $temp); - } + $temp = is_array($val) + ? $this->_parse_pair($key, $val, $temp) + : $this->_parse_single($key, $val, $temp); } $str .= $temp; |