From 4e4fd050349b00ea2aa5a4cd340d7846761deaf4 Mon Sep 17 00:00:00 2001
From: nate
Date: Thu, 8 Nov 2007 15:30:23 +0000
Subject: [PATCH] Fixing conflicting var names in scaffold
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5968 3807eeeb-6ff5-0310-8944-8be069107fe0
---
cake/libs/controller/scaffold.php | 4 ++--
cake/libs/view/templates/scaffolds/index.ctp | 4 ++--
cake/libs/view/templates/scaffolds/view.ctp | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php
index 0573ad96e..c1f050d53 100644
--- a/cake/libs/controller/scaffold.php
+++ b/cake/libs/controller/scaffold.php
@@ -176,11 +176,11 @@ class Scaffold extends Object {
$pluralVar = Inflector::variable($this->controller->name);
$singularHumanName = Inflector::humanize($modelClass);
$pluralHumanName = Inflector::humanize($this->controller->name);
- $fields = array_keys($this->ScaffoldModel->schema());
+ $scaffoldFields = array_keys($this->ScaffoldModel->schema());
$associations = $this->__associations();
$this->controller->set(compact('modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
- 'singularHumanName', 'pluralHumanName', 'fields', 'associations'));
+ 'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations'));
$this->__scaffold($params);
}
diff --git a/cake/libs/view/templates/scaffolds/index.ctp b/cake/libs/view/templates/scaffolds/index.ctp
index 47995d23c..5bce40ee0 100644
--- a/cake/libs/view/templates/scaffolds/index.ctp
+++ b/cake/libs/view/templates/scaffolds/index.ctp
@@ -33,7 +33,7 @@ echo $paginator->counter(array(
?>
-
+
sort($field);?> |
|
@@ -47,7 +47,7 @@ foreach (${$pluralVar} as ${$singularVar}):
}
echo "\n";
echo "\t
\n";
- foreach ($fields as $field) {
+ foreach ($scaffoldFields as $field) {
$isKey = false;
if(!empty($associations['belongsTo'])) {
foreach ($associations['belongsTo'] as $alias => $details) {
diff --git a/cake/libs/view/templates/scaffolds/view.ctp b/cake/libs/view/templates/scaffolds/view.ctp
index 22444e67e..ccacc288f 100644
--- a/cake/libs/view/templates/scaffolds/view.ctp
+++ b/cake/libs/view/templates/scaffolds/view.ctp
@@ -29,7 +29,7 @@