hello everyone!
I'm building a simple web page, with Auth/ACL and a few members.
Problem is, I baked the admin part of the site, and everything works fine
except for one thing! In my users admin page, I click in "view", but it
insists in showing the view for the first user (in this case, the admin).
In my url, it shows /users/view/7 (number of the user's ID), but it shows
the data for the user with ID == 1.
Funny thing is, if I click EDIT instead of VIEW, it shows the correct user!
(and the URL is /users/edit/7)
Here are the codes for the VIEWS/USERS/INDEX.CTP :
[code]
<?php
$i = 0;
foreach ($users as $user):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<?php echo $user['User']['username']; ?>
</td>
<td>
<?php echo $user['User']['name']; ?>
</td>
<td>
<?php echo $user['User']['email']; ?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true),
array('action'=>'view',
$user['User']['id'])); ?>
<?php echo $html->link(__('Edit', true),
array('action'=>'edit',
$user['User']['id'])); ?>
<?php echo $html->link(__('Delete', true),
array('action'=>'delete',
$user['User']['id']), null, sprintf(__('Are you sure you want to delete #
%s?', true), $user['User']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
[/code]
And here's for the action view in the users_Controller.php:
[code]
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid User.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('user', $this->User->read(null, $id));
}
[/code]
What could be the problem?
THanks!!!
--
View this message in context:
http://www.nabble.com/Problem-viewing-data...-tp25530475p25530475.html
Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---