Hi
I will post a question Symfony2 form.
Symfony2 form allows you configure in the method
Fill in the field is to add logic
Please consult field will add control of the case depends on the data.

<?php
class Contact{
    protected $replyType;
    protected $email;
    protected $tel;
}
class ContactFormToday{
    public function configure(){
                $this->add(new
ChoiceField('replyType'),array('choices'=>array('0'=>'email','0'=>'tel')));
        }
}
class ContactFormTomorrow{
    public function configure(){
                $data = $this->getData();
                $replyType = $data->getReplyType();
                if($replyType){
                        $this->add(new TextField('tel'));
                }else{
                        $this->add(new TextField('email'));
                }
        }
}

Considering that the code is like above.
Contact two times to complete a form I in
In ContactFormTomorrow replyType determined from
I would like to display only the required fields.
But in the current form of the building
configure () -> setData ()
Configure and order without the possibility to obtain data internally.

If you have any good way,
I ask everyone thank you.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" 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/symfony-users?hl=en

Reply via email to