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
This commit is contained in:
nate 2007-11-08 15:30:23 +00:00
parent 42767170d1
commit 4e4fd05034
3 changed files with 5 additions and 5 deletions

View file

@ -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);
}

View file

@ -33,7 +33,7 @@ echo $paginator->counter(array(
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<?php foreach ($fields as $field):?>
<?php foreach ($scaffoldFields as $field):?>
<th><?php echo $paginator->sort($field);?></th>
<?php endforeach;?>
<th><?php __('Actions');?></th>
@ -47,7 +47,7 @@ foreach (${$pluralVar} as ${$singularVar}):
}
echo "\n";
echo "\t<tr{$class}>\n";
foreach ($fields as $field) {
foreach ($scaffoldFields as $field) {
$isKey = false;
if(!empty($associations['belongsTo'])) {
foreach ($associations['belongsTo'] as $alias => $details) {

View file

@ -29,7 +29,7 @@
<dl>
<?php
$i = 0;
foreach ($fields as $field) {
foreach ($scaffoldFields as $field) {
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';