폼 객체 내의 속성에 액세스해야합니다. 문제는 액세스하려는 속성이 형식으로 렌더링되지 않고 contractType 클래스에서 선언되지 않는다는 것입니다.Symfony 2.7 : 폼 객체 내에서 렌더링 된 속성이 액세스되지 않습니다.
class ContractType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('rcode1', new TextType(), array('label' => 'rcode 1'))
->add('rcode2', new TextType(), array('label' => 'rcode 2'));
}
...
}
덤프 형태 개체 :
array:6 [▼
"contract" => Contract {#2003 ▼
- id: null
- actionCode: "104"
- productCode: "20106"
- created: null
- updated: null
- resumeId: null
- rcode1: null
- rcode2: null
- downloadId: null
- businessContractDetails: BusinessContractDetails {#1999 ▶}
- privateContractDetails: null
- company: Company {#2000 ▶}
- persons: ArrayCollection {#1998 ▶}
}
"businessContractDetails" => BusinessContractDetails {#1999 ▶}
"company" => Company {#2000 ▶}
"contactPerson" => ContactPerson {#1987 ▶}
"landlord" => Landlord {#1993 ▶}
"businessRealEstate" => BusinessRealEstate {#1994 ▶}
]
계약 엔티티의 렌더링되는 속성 및 RCODE1 RCODE2이다. 하지만 downloadID에 대한 액세스 권한이 필요합니다.
나는$form->get('contract')->get('downloadId')->getData();
을 시도하고 다음과 같은 오류 메시지가 있어요 :
아이 "downloadId"존재하지 않습니다.
제안 사항? 미리 감사드립니다!
아 ... 감사합니다! 그게 도움이 됐어! – Zebula
제발 대답을 투표하는 것을 잊지 마세요 :) –
죄송합니다, 나는 명성 포인트가 15 점 미만입니다. 나는 당신의 대답을 upvote 수 없습니다 : ( – Zebula