Skip to content
This repository
Browse code

create View instance after adding model params for request

  • Loading branch information...
commit 677f0708dc3d60dced04bd91e35abfe6527d07e4 1 parent 4edb378
ceeram authored February 24, 2012

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. 18  lib/Cake/Controller/Controller.php
18  lib/Cake/Controller/Controller.php
@@ -903,15 +903,6 @@ public function render($view = null, $layout = null) {
903 903
 			return $this->response;
904 904
 		}
905 905
 
906  
-		$viewClass = $this->viewClass;
907  
-		if ($this->viewClass != 'View') {
908  
-			list($plugin, $viewClass) = pluginSplit($viewClass, true);
909  
-			$viewClass = $viewClass . 'View';
910  
-			App::uses($viewClass, $plugin . 'View');
911  
-		}
912  
-
913  
-		$View = new $viewClass($this);
914  
-
915 906
 		if (!empty($this->uses)) {
916 907
 			foreach ($this->uses as $model) {
917 908
 				list($plugin, $className) = pluginSplit($model);
@@ -922,6 +913,15 @@ public function render($view = null, $layout = null) {
922 913
 			$this->request->params['models'][$this->modelClass] = array('plugin' => $this->plugin, 'className' => $this->modelClass);
923 914
 		}
924 915
 
  916
+		$viewClass = $this->viewClass;
  917
+		if ($this->viewClass != 'View') {
  918
+			list($plugin, $viewClass) = pluginSplit($viewClass, true);
  919
+			$viewClass = $viewClass . 'View';
  920
+			App::uses($viewClass, $plugin . 'View');
  921
+		}
  922
+
  923
+		$View = new $viewClass($this);
  924
+
925 925
 		$models = ClassRegistry::keys();
926 926
 		foreach ($models as $currentModel) {
927 927
 			$currentObject = ClassRegistry::getObject($currentModel);

0 notes on commit 677f070

Please sign in to comment.
Something went wrong with that request. Please try again.