$this->add([ 'name' => 'gender', 'type' => Element\Radio::class, 'attributes' => [ 'class' => 'form-check-input', ], 'options' => [ 'label' => '성별', 'label_attributes' => [ 'class' => 'col-sm-2 control-label', ], 'value_options' => [ 'M' => '남자', 'F' => '여자', ] ] ]); $element = $this->get('gender'); $element->setLabelOptions(['disable_html_escape' => true]);
위 코드를 이용하면 아래와 같이 Zend/Form으로 Radio버튼을 생성 할때도 뒤에 을 삽입할 수 있다.
새댓글 등록