You can access the data in the view in $this->data array. (not $data).
JmN
On 9 dic, 17:02, WebbedIT <[EMAIL PROTECTED]> wrote:
> Hopefully a simple one to answer.
>
> In my controllers, if I add data into the $this->data array form
> fields are automatically populated
>
> Controller:
> $this->data['StaffHour']['staff_id'] = 123;
>
> View:
> echo $form->input('StaffHour.staff_id', array('type' => 'hidden'));
>
> HTML Output:
> <input name="data[StaffHour][staff_id]" value="123"
> id="StaffHourStaffId" type="hidden">
>
> However when I then try to access the $data array elsewhere in the
> view it is undefined?!?
>
> Elsewhere in view:
> <?php echo $html->link(__('Cancel', true), array('action'=>'index',
> $data['StaffHour']['staff_id']));?>
>
> Nor can I user debug($data) ... this is highly confusing, how does the
> form helper access the $data array?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---