mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-05-30 11:23:29 +00:00
Pulling construction of Scaffold into a method so its
easier to allow plugins/user classes to replace the core Scaffold class.
This commit is contained in:
parent
b56931383c
commit
f28b42de2f
1 changed files with 14 additions and 3 deletions
|
@ -464,7 +464,7 @@ class Controller extends Object {
|
|||
|
||||
} catch (ReflectionException $e) {
|
||||
if ($this->scaffold !== false) {
|
||||
return new Scaffold($this, $request);
|
||||
return $this->_getScaffold($request);
|
||||
}
|
||||
throw new MissingActionException(array(
|
||||
'controller' => $this->name . "Controller",
|
||||
|
@ -474,8 +474,8 @@ class Controller extends Object {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if the request's action is marked as private, with an underscore, of if the request is attempting to
|
||||
* directly accessing a prefixed action.
|
||||
* Check if the request's action is marked as private, with an underscore,
|
||||
* or if the request is attempting to directly accessing a prefixed action.
|
||||
*
|
||||
* @param ReflectionMethod $method The method to be invoked.
|
||||
* @param CakeRequest $request The request to check.
|
||||
|
@ -497,6 +497,17 @@ class Controller extends Object {
|
|||
}
|
||||
return $privateAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a scaffold object to use for dynamically scaffolded controllers.
|
||||
*
|
||||
* @param CakeRequest $request
|
||||
* @return Scaffold
|
||||
*/
|
||||
protected function _getScaffold(CakeRequest $request) {
|
||||
return new Scaffold($this, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge components, helpers, and uses vars from Controller::$_mergeParent and PluginAppController.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue