Пример #1
0
 protected function buildForm()
 {
     parent::buildForm(true);
     $this->formBuilder->add('id', 'hidden', ['constraints' => [new GreaterThan(['value' => 0])]])->add('need_zip_code', 'checkbox', ['required' => false, 'label' => $this->translator->trans('Addresses for this country need a zip code'), 'label_attr' => ['for' => 'need_zip_code']])->add('zip_code_format', 'text', ['required' => false, 'constraints' => [], 'label' => $this->translator->trans('The zip code format'), 'label_attr' => ['help' => $this->translator->trans('Use a N for a number, L for Letter, C for an iso code for the state.')]]);
     // Add standard description fields, excluding title and locale, which a re defined in parent class
     $this->addStandardDescFields(['title', 'locale']);
 }
Пример #2
0
 protected function buildForm()
 {
     parent::buildForm(true);
     $this->formBuilder->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))));
     // Add standard description fields, excluding title and locale, which a re defined in parent class
     $this->addStandardDescFields(array('title', 'locale'));
 }