mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
bake: fixing pluralName error
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3694 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
0f4783b2ad
commit
251bf74e6a
1 changed files with 3 additions and 4 deletions
|
@ -1271,14 +1271,13 @@ class Bake {
|
|||
}
|
||||
}
|
||||
|
||||
function __bakeActions($controllerName, $admin, $wannaUseSession) {
|
||||
function __bakeActions($controllerName, $admin = null, $wannaUseSession = 'y') {
|
||||
$currentModelName = $this->__modelName($controllerName);
|
||||
$modelKey = Inflector::underscore($currentModelName);
|
||||
$pluralName = $this->__pluralrName($currentModelName);
|
||||
$singularName = $this->__singularName($currentModelName);
|
||||
$singularHumanName = $this->__singularHumanName($currentModelName);
|
||||
$pluralHumanName = $this->__pluralHumanName($controllerName);
|
||||
|
||||
|
||||
if(!class_exists($currentModelName)) {
|
||||
$this->stdout('You must have a model for this class to build scaffold methods. Please try again.');
|
||||
exit;
|
||||
|
@ -1287,7 +1286,7 @@ class Bake {
|
|||
$actions .= "\n";
|
||||
$actions .= "\tfunction {$admin}index() {\n";
|
||||
$actions .= "\t\t\$this->{$currentModelName}->recursive = 0;\n";
|
||||
$actions .= "\t\t\$this->set('{$controllerPath}', \$this->{$currentModelName}->findAll());\n";
|
||||
$actions .= "\t\t\$this->set('{$pluralName}', \$this->{$currentModelName}->findAll());\n";
|
||||
$actions .= "\t}\n";
|
||||
$actions .= "\n";
|
||||
$actions .= "\tfunction {$admin}view(\$id = null) {\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue