mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
fix bug in model names
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4087 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
2bab8c5f57
commit
d67977bba0
1 changed files with 3 additions and 8 deletions
|
@ -901,11 +901,6 @@ class Bake {
|
||||||
|
|
||||||
//-------------------------[INDEX]-------------------------//
|
//-------------------------[INDEX]-------------------------//
|
||||||
$indexView = null;
|
$indexView = null;
|
||||||
if(!empty($modelObj->alias)) {
|
|
||||||
foreach ($modelObj->alias as $key => $value) {
|
|
||||||
$alias[] = $key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$indexView .= "<div class=\"{$pluralName}\">\n";
|
$indexView .= "<div class=\"{$pluralName}\">\n";
|
||||||
$indexView .= "<h2>List " . $pluralHumanName . "</h2>\n\n";
|
$indexView .= "<h2>List " . $pluralHumanName . "</h2>\n\n";
|
||||||
$indexView .= "<table cellpadding=\"0\" cellspacing=\"0\">\n";
|
$indexView .= "<table cellpadding=\"0\" cellspacing=\"0\">\n";
|
||||||
|
@ -928,7 +923,7 @@ class Bake {
|
||||||
$otherControllerPath = $this->__controllerPath($otherControllerName);
|
$otherControllerPath = $this->__controllerPath($otherControllerName);
|
||||||
if(is_object($otherModelObj)) {
|
if(is_object($otherModelObj)) {
|
||||||
$displayField = $otherModelObj->getDisplayField();
|
$displayField = $otherModelObj->getDisplayField();
|
||||||
$indexView .= "\t<td> <?php echo \$html->link(\$".$singularName."['{$alias[$count]}']['{$displayField}'], '{$admin_url}/" . $otherControllerPath . "/view/' .\$".$singularName."['{$alias[$count]}']['{$otherModelObj->primaryKey}'])?></td>\n";
|
$indexView .= "\t<td> <?php echo \$html->link(\$".$singularName."['{$otherModelName}']['{$displayField}'], '{$admin_url}/" . $otherControllerPath . "/view/' .\$".$singularName."['{$otherModelName}']['{$otherModelObj->primaryKey}'])?></td>\n";
|
||||||
} else {
|
} else {
|
||||||
$indexView .= "\t<td><?php echo \$".$singularName."['{$modelObj->name}']['{$field}']; ?></td>\n";
|
$indexView .= "\t<td><?php echo \$".$singularName."['{$modelObj->name}']['{$field}']; ?></td>\n";
|
||||||
}
|
}
|
||||||
|
@ -958,7 +953,7 @@ class Bake {
|
||||||
$viewView .= "<dl>\n";
|
$viewView .= "<dl>\n";
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach($fieldNames as $field => $value) {
|
foreach($fieldNames as $field => $value) {
|
||||||
$viewView .= "\t<dt>" . $value['prompt'] . "</dt>\n";
|
$viewView .= "\t<dt>" . $value['label'] . "</dt>\n";
|
||||||
if(isset($value['foreignKey'])) {
|
if(isset($value['foreignKey'])) {
|
||||||
$otherModelName = $this->__modelName($value['model']);
|
$otherModelName = $this->__modelName($value['model']);
|
||||||
$otherModelKey = Inflector::underscore($value['modelKey']);
|
$otherModelKey = Inflector::underscore($value['modelKey']);
|
||||||
|
@ -966,7 +961,7 @@ class Bake {
|
||||||
$otherControllerName = $this->__controllerName($value['modelKey']);
|
$otherControllerName = $this->__controllerName($value['modelKey']);
|
||||||
$otherControllerPath = $this->__controllerPath($otherControllerName);
|
$otherControllerPath = $this->__controllerPath($otherControllerName);
|
||||||
$displayField = $otherModelObj->getDisplayField();
|
$displayField = $otherModelObj->getDisplayField();
|
||||||
$viewView .= "\t<dd> <?php echo \$html->link(\$".$singularName."['{$alias[$count]}']['{$displayField}'], '{$admin_url}/" . $otherControllerPath . "/view/' .\$".$singularName."['{$alias[$count]}']['{$otherModelObj->primaryKey}'])?></dd>\n";
|
$viewView .= "\t<dd> <?php echo \$html->link(\$".$singularName."['{$otherModelName}']['{$displayField}'], '{$admin_url}/" . $otherControllerPath . "/view/' .\$".$singularName."['{$otherModelName}']['{$otherModelObj->primaryKey}'])?></dd>\n";
|
||||||
$count++;
|
$count++;
|
||||||
} else {
|
} else {
|
||||||
$viewView .= "\t<dd> <?php echo \$".$singularName."['{$modelObj->name}']['{$field}']?></dd>\n";
|
$viewView .= "\t<dd> <?php echo \$".$singularName."['{$modelObj->name}']['{$field}']?></dd>\n";
|
||||||
|
|
Loading…
Reference in a new issue