Upgrade to 3.9.2
This commit is contained in:
@@ -482,28 +482,23 @@ class App
|
||||
|
||||
/**
|
||||
* Try to find a controller by name
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $contentType
|
||||
* @return \Kirby\Toolkit\Controller|null
|
||||
*/
|
||||
protected function controllerLookup(string $name, string $contentType = 'html')
|
||||
protected function controllerLookup(string $name, string $contentType = 'html'): Controller|null
|
||||
{
|
||||
if ($contentType !== null && $contentType !== 'html') {
|
||||
$name .= '.' . $contentType;
|
||||
}
|
||||
|
||||
// controller on disk
|
||||
if ($controller = Controller::load($this->root('controllers') . '/' . $name . '.php')) {
|
||||
// controller from site root
|
||||
$controller = Controller::load($this->root('controllers') . '/' . $name . '.php');
|
||||
// controller from extension
|
||||
$controller ??= $this->extension('controllers', $name);
|
||||
|
||||
if ($controller instanceof Controller) {
|
||||
return $controller;
|
||||
}
|
||||
|
||||
// registry controller
|
||||
if ($controller = $this->extension('controllers', $name)) {
|
||||
if ($controller instanceof Controller) {
|
||||
return $controller;
|
||||
}
|
||||
|
||||
if ($controller !== null) {
|
||||
return new Controller($controller);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user