Skip to content
This repository
Browse code

MINOR Use injector to create controllers in ModelAsController

  • Loading branch information...
commit 9f51c87884c0ba06997eef94cc1c5d409fc20739 1 parent ad28780
authored May 30, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  code/controllers/ModelAsController.php
2  code/controllers/ModelAsController.php
@@ -24,7 +24,7 @@ public static function controller_for(SiteTree $sitetree, $action = null) {
24 24
 			$controller = $controller . '_' . ucfirst($action);
25 25
 		}
26 26
 		
27  
-		return class_exists($controller) ? new $controller($sitetree) : $sitetree;
  27
+		return class_exists($controller) ? Injector::inst()->create($controller, $sitetree) : $sitetree;
28 28
 	}
29 29
 	
30 30
 	public function init() {

0 notes on commit 9f51c87

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