Cant get my head around how to do this. I’m wanting to set a “Edit your account” link in the nav of a layout (layout/default.ctp). I want to give the logged in user access to only edit there details (I’ll also handle this in the controller to check its the currently logged in users). But how do I do it in the layout?
I tried this and failed:
<?php echo $this->Html->link('Your Account', array('controller' => 'users', 'action' => 'edit', $this->Auth->users('id')));?>
Sorry, I’ve been over complicating things. To solve this I wrote this in the layout:
and passed the ID in the edit function in the users controller like this
Hope this helps someone.