2013-10-24 2 views
1

을 사용하여 Product 관리자에게 Product Variant을 삽입하려고합니다. 나는 내 광고 지금SonataAdmin - 양식 모음

Product.php

/** 
* @var ProductVariant $variants 
* @ORM\ManyToMany(targetEntity="ProductVariant", cascade={"persist", "remove"}) 
**/ 
protected $variants; 

ProductVariant.php

/** 
* @ORM\ManyToOne(targetEntity="Product", inversedBy="variants") 
* @ORM\JoinColumn(name="product_id", referencedColumnName="id") 
*/ 
protected $product; 

다음과 같습니다

그래서 one 제품은 나는 다음과 같은 엔티티 한 many 변형

있다 분 Form 클래스 : 이것은 추가 버튼 새로운 변종 추가 할 수 있지만, 클릭 한 후, 내가 행이 inline 것으로 기대하고 table 내에서하지만, 이러한 옵션이되어 있지 않은 것 같습니다 표시

 ->add('variants','collection', array(
      'type' => new ProductVariantType(), 
      'allow_add' => true, 
     ), array(
      'edit' => 'inline', 
      'inline' => 'table', 
     )) 

방아쇠를 당겼다.

감사

답변

0

sonata_type_collection 옵션을 'edit''inline'을 지원합니다. 코어가 아닌 collection 유형.