mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
Merge pull request #140 from nyeholt/master
Use the dependency injector for creating controllers
This commit is contained in:
commit
4710011978
@ -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…
x
Reference in New Issue
Block a user