Hi,
I have a CV controller that Uses two models : Users and Companies
Users HABTM Companies with a join table with :
id (int)
user_id (int)
company_id (int)
start_date (date)
end_date (date)
description (text)
current(boolean)
when retreiving data in my view :
<?php $i = 0; ?>
<?php echo $form->create('Cv', array('action' =>
'edit'));?>
<?php echo $form->input('User.id', array('type' =>
'hidden')); ?>
<?php echo
$form->input('Company.'.$i.'.UsersCompany.is_school',
array('type' => 'select', 'options' => array('1' => 'School', '0' =>
'Work'), 'empty' => 'Type of experience ?')); ?>
<div class="input text">
<label for="<?php echo
'Company'.$i.'Name' ?>"><?php echo __
('School name'); ?></label>
<?php echo
$ajax->autoComplete('Company.'.$i.'.name', '/cvs/
companyComplete/'.$i); ?>
</div>
<?php echo $form->input('Company.'.
$i.'.UsersCompany.description');
echo
$form->input('Company.'.$i.'.UsersCompany.start_date');
echo
$form->input('Company.'.$i.'.UsersCompany.end_date', array
('type' => 'date', 'dateFormat' => 'MY', 'minYear' => date('Y') - 90 ,
'maxYear' => date('Y') + 5, 'empty' => true));
echo
$form->input('Company.'.$i.'.UsersCompany.current', array
('type' => 'checkbox'));
On the first 'start_date' field, the fields is a input/text one (with
proper value populated)
The second one is also OK in the browser but the select fields name
are incorrect) as it produces the following HTML :
<label for="Company0UsersCompanyEndDateMonth">End Date</label><select
name="data[Cv]" id="Cv">...
where it should be :
<label for="Company0UsersCompanyEndDateMonth">End Date</label><select
name="data[Company][0][UsersCompany][EndDate][Month]" id="Cv">
Am I missing something ?
Thanks !
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---