I've got Task entity which has nothing to do with Company entity ( Company has Projects, and each Project has Tasks ) and this simple form:
class TaskType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('company','entity',array(
'class' => 'ITMore\FlowBundle\Entity\Company',
'mapped' => false
))
}
}
and what I want to do is to render this field as text type, so I can auto-complete it with jquery ( friendly User experience. There will be a lot of projects, so I don't want user to search through the whole list ). It is supposed to work like this: user fill the company field, then the list of companies which fits input value shows and after that there is second input - project - which is supposed to have hints with the given companies projects.
I have absolutely no idea how to do this. One way which I thought it may work is to do this in controller after validation, but this solution isn't very neat