mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
42767170d1
commit
4e4fd05034
3 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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"';
|
||||
|
|
Loading…
Reference in a new issue