mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API Move NestedController from cms to framework
This commit is contained in:
parent
2ea65e9064
commit
1c3ec19353
@ -363,7 +363,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
||||
if(isset($this->requestParams['formController'])) {
|
||||
$formController = Director::getControllerForURL($this->requestParams['formController']);
|
||||
|
||||
while(is_a($formController, 'NestedController')) {
|
||||
while ($formController instanceof NestedController) {
|
||||
$formController = $formController->getNestedController();
|
||||
}
|
||||
return $formController;
|
||||
|
19
control/NestedController.php
Normal file
19
control/NestedController.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Interface that is implemented by controllers that are designed to hand control over to another controller.
|
||||
* ModelAsController, which selects up a SiteTree object and passes control over to a suitable subclass of ContentController, is a good
|
||||
* example of this.
|
||||
*
|
||||
* Controllers that implement this interface must always return a nested controller.
|
||||
*/
|
||||
interface NestedController {
|
||||
|
||||
/**
|
||||
* Get overriding controller
|
||||
*
|
||||
* @return Controller
|
||||
*/
|
||||
public function getNestedController();
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user