tags:

views:

20

answers:

1

hi all,

how can i get ID of current record, on Edit view layout?

tnx in adv!

+2  A: 

You can load the Model in question and access it that way from within the view (which, in my opinion, is an awful idea) or you can 'set' it within your controller action:

// In the controller action that renders the view
$this->set('current_id',$this->ModelName->id);

// Access it this way in the view/layout:
<?php echo $current_id; ?>

You could also grab the current record ID using ajax, but that doesn't sound like something that would benefit you here.

Good luck

inkedmn