mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Allow DevelopmentAdmin to have subclasses (#9702)
This commit is contained in:
parent
d6cb539335
commit
2042d1c6b0
@ -130,7 +130,7 @@ class DevelopmentAdmin extends Controller
|
||||
$controllerClass = null;
|
||||
|
||||
$baseUrlPart = $request->param('Action');
|
||||
$reg = Config::inst()->get(__CLASS__, 'registered_controllers');
|
||||
$reg = Config::inst()->get(static::class, 'registered_controllers');
|
||||
if (isset($reg[$baseUrlPart])) {
|
||||
$controllerClass = $reg[$baseUrlPart]['controller'];
|
||||
}
|
||||
@ -139,7 +139,7 @@ class DevelopmentAdmin extends Controller
|
||||
return $controllerClass::create();
|
||||
}
|
||||
|
||||
$msg = 'Error: no controller registered in ' . __CLASS__ . ' for: ' . $request->param('Action');
|
||||
$msg = 'Error: no controller registered in ' . static::class . ' for: ' . $request->param('Action');
|
||||
if (Director::is_cli()) {
|
||||
// in CLI we cant use httpError because of a bug with stuff being in the output already, see DevAdminControllerTest
|
||||
throw new Exception($msg);
|
||||
@ -162,7 +162,7 @@ class DevelopmentAdmin extends Controller
|
||||
{
|
||||
$links = [];
|
||||
|
||||
$reg = Config::inst()->get(__CLASS__, 'registered_controllers');
|
||||
$reg = Config::inst()->get(static::class, 'registered_controllers');
|
||||
foreach ($reg as $registeredController) {
|
||||
if (isset($registeredController['links'])) {
|
||||
foreach ($registeredController['links'] as $url => $desc) {
|
||||
@ -175,7 +175,7 @@ class DevelopmentAdmin extends Controller
|
||||
|
||||
protected function getRegisteredController($baseUrlPart)
|
||||
{
|
||||
$reg = Config::inst()->get(__CLASS__, 'registered_controllers');
|
||||
$reg = Config::inst()->get(static::class, 'registered_controllers');
|
||||
|
||||
if (isset($reg[$baseUrlPart])) {
|
||||
$controllerClass = $reg[$baseUrlPart]['controller'];
|
||||
|
Loading…
Reference in New Issue
Block a user