mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
updating scaffold, fixes #3367
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5734 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
356fd587cd
commit
8fbcfe5239
1 changed files with 5 additions and 8 deletions
|
@ -303,15 +303,12 @@ class Scaffold extends Object {
|
|||
}
|
||||
|
||||
foreach ($this->ScaffoldModel->belongsTo as $assocName => $assocData) {
|
||||
$varName = $assocName;
|
||||
if($this->ScaffoldModel->name == $assocData['className']) {
|
||||
$varName = $assocData['className'];
|
||||
$varName = Inflector::variable(Inflector::pluralize(preg_replace('/_id$/', '', $assocData['foreignKey'])));
|
||||
$this->controller->set($varName, $this->ScaffoldModel->{$assocName}->generateList());
|
||||
}
|
||||
$this->controller->set(Inflector::pluralize(Inflector::variable($varName)), $this->ScaffoldModel->{$assocName}->generateList());
|
||||
}
|
||||
|
||||
foreach ($this->ScaffoldModel->hasAndBelongsToMany as $assocName => $assocData) {
|
||||
$this->controller->set(Inflector::pluralize(Inflector::variable($varName)), $this->ScaffoldModel->{$assocName}->generateList());
|
||||
$varName = Inflector::variable(Inflector::pluralize($assocName));
|
||||
$this->controller->set($varName, $this->ScaffoldModel->{$assocName}->generateList());
|
||||
}
|
||||
|
||||
return $this->__scaffoldForm($formAction);
|
||||
|
|
Loading…
Add table
Reference in a new issue