Skip to content
Advertisement

CollectionType elements missing data

I’ve embedded forms with CollectionType: and ‘battlePages’ is an ArrayCollection with many elements. But ‘$entity’ is empty however collection was walking through. My goal would be to get BattlePage entity’s data in the ‘BattlePageCollectionType’ which is my second in examples ($entity). Anybody had have similar issues? Answer The $builder->getData(); method doesn’t return an entity. You should use Form Events Example

select option to fetch other inputs

What Im trying to do is select item name where is ID and if item selected it automatically adds that item serial number to serial number input. I think it should be used ajax maybe but I dont know how …

Advertisement