Sunday, July 4, 2010

Re: hasOne make me crazy... now read() doesn't work

customer/edit/1

<?php echo $this->Form->create('Customer');?>
<fieldset>
<legend><?php __('Edit Customer'); ?></legend>
<?php
echo $this->Form->input('User.username', array('label' =>
__('Username', true)));
echo $this->Form->input('User.password', array('label' =>
__('Password', true), 'value'=>''));
echo $this->Form->input('User.password_confirm', array('type' =>
'password', 'label' => __('Password confirm', true),'value'=>''));
echo $this->Form->input('Customer.business_name', array('label' =>
__('Business name', true)));
echo $this->Form->input('Customer.governamental_code', array('label'
=> __('Governamental code', true)));
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>


==> just show values for "Customer" table fields (business_name,
governamental_code). Why?


On 4 jul, 20:20, Davor Ilic <webfa...@gmail.com> wrote:
> show your edit.ctp
>
> 2010/7/5 guvilla <guvi...@gmail.com>
>
> > TABLE
> > Groups: id, nome
> > Users: id, username, password, group_id
> > Customers: id, governamental_code, business_name, user_id
> > Employee: id, name, user_id
>
> > MODEL
> > USER
> >        var $belongsTo = array(
> >                                        'Group' => array(
> >                                                'className' => 'Group',
> >                                                'foreignKey' => 'group_id'
> >                                        ),
> >                                        'Customer' => array(
> >                                                'className' => 'Customer',
> >                                                'foreignKey' => 'id'
> >                                        )
> >                                );
>
> > CUSTOMER
> >        var $hasOne = array(
> >                'User' => array(
> >                        'className' => 'User',
> >                        'foreignKey' => 'id',
> >                )
> >        );
>
> > MY PROBLEM:
> > when I access /customer/edit/1, only shows customer data, but not user
> > data. I don't know how to solve... Who knows?
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: