4
엔티티 필드가 내 양식에 있습니다. 이 필드는 다음과 같습니다.Symfony 2 엔티티 필드 속성
->add('user', 'entity',array(
'class' => 'Elearning\SiteBundle\Entity\User',
'property' => 'name',
'multiple' => true,
'expanded' => true,
'required' => true,
'label' => 'Użytkownicy ',
'attr' => array('class' => 'userFiledCollection'), // this not working. It set class to parent div. I want to have this class in checkboxes.
'query_builder' =>function(EntityRepository $er) {
return $er
->createQueryBuilder('u')
->where('u.isActive = 1');
},
)
)
내가 원하는 것은이 필드에 의해 렌더링 된 모든 확인란에 클래스 속성을 설정하는 것입니다. 내가 어떻게 할 수 있니?
모든 체크 박스에 같은 클래스? 정말로해야하니? CSS를 이용한 경험 법칙 : 모든 요소에 동일한 클래스를 부여하면 잘못된 결과가 발생합니다. 예를 들어 자손 선택자를 사용하여 스타일을 지정할 수 있습니다 :'.userFiledCollection input [type = checkbox] {...}' – RoToRa