Skip to content
Browse files

MINOR Use injector to create controllers in ModelAsController

  • Loading branch information...
1 parent ad28780 commit 9f51c87884c0ba06997eef94cc1c5d409fc20739 Marcus Nyeholt committed May 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 code/controllers/ModelAsController.php
View
2 code/controllers/ModelAsController.php
@@ -24,7 +24,7 @@ public static function controller_for(SiteTree $sitetree, $action = null) {
$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() {

0 comments on commit 9f51c87

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