mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02: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…
Reference in New Issue
Block a user