Move object code to same code block

pull/11/head
Mike Cao 14 years ago
parent 0eca364fe5
commit aab7471c85

@ -22,16 +22,11 @@ class View {
public function render($file, $data = null) {
// Bind template data to view
if (!is_null($data)) {
if (is_array($data)) {
if (is_array($data) || is_object($data)) {
foreach ($data as $key => $value) {
$this->{$key} = $value;
}
}
else if (is_object($data)) {
foreach (get_object_vars($data) as $key => $value) {
$this->{$key} = $value;
}
}
}
// Display template

Loading…
Cancel
Save