From 9f51c87884c0ba06997eef94cc1c5d409fc20739 Mon Sep 17 00:00:00 2001 From: Marcus Nyeholt Date: Wed, 30 May 2012 15:09:25 +1000 Subject: [PATCH] MINOR Use injector to create controllers in ModelAsController --- code/controllers/ModelAsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/ModelAsController.php b/code/controllers/ModelAsController.php index f5455d8e..c1d260f8 100644 --- a/code/controllers/ModelAsController.php +++ b/code/controllers/ModelAsController.php @@ -24,7 +24,7 @@ class ModelAsController extends Controller implements NestedController { $controller = $controller . '_' . ucfirst($action); } - return class_exists($controller) ? new $controller($sitetree) : $sitetree; + return class_exists($controller) ? Injector::inst()->create($controller, $sitetree) : $sitetree; } public function init() {