Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Use injector to create controllers in ModelAsController

  • Loading branch information...
commit 9f51c87884c0ba06997eef94cc1c5d409fc20739 1 parent ad28780
Marcus Nyeholt authored
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() {
Please sign in to comment.
Something went wrong with that request. Please try again.