mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Use injector to create controllers in ModelAsController
This commit is contained in:
parent
ad28780959
commit
9f51c87884
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user