diff --git a/libraries/legacy/controller/legacy.php b/libraries/legacy/controller/legacy.php index f996bbfa6a063..a693ea945efa4 100644 --- a/libraries/legacy/controller/legacy.php +++ b/libraries/legacy/controller/legacy.php @@ -847,14 +847,19 @@ public function getView($name = '', $type = '', $prefix = '', $config = array()) if (empty($prefix)) { - $prefix = $this->getName() . 'View'; + $prefix = $this->getName() . 'view'; } - if (empty($views[$name])) + $layout = isset($config['layout']) ? $config['layout'] : ''; + + $prefix = strtolower($prefix); + + + if (empty($views[$name][$type][$prefix][$layout])) { if ($view = $this->createView($name, $prefix, $type, $config)) { - $views[$name] = & $view; + $views[$name][$type][$prefix][$layout] = & $view; } else { @@ -862,7 +867,7 @@ public function getView($name = '', $type = '', $prefix = '', $config = array()) } } - return $views[$name]; + return $views[$name][$type][$prefix][$layout]; } /**