mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +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);
|
$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() {
|
public function init() {
|
||||||
|
Loading…
Reference in New Issue
Block a user