2013-08-27 3 views
0

여기에 하나의 텍스트 상자 집합이 있습니다.Zend Form 디스플레이 그룹에 요소 배열 추가

$this->addElement('text', '1', array(
     'label' => 'Text One', 
     'belongsTo' => 'txtarray' 
    )); 

    $this->addElement('text', '2', array(
     'label' => 'Text Two', 
     'belongsTo' => 'txtarray' 
    )); 

    $this->addElement('text', '3', array(
     'label' => 'Text Three', 
     'belongsTo' => 'txtarray' 
    )); 

나는 하나 개의 디스플레이 그룹

$this->addDisplayGroup(array('txtarray'), 'pcinfo', array('legend' => 'Other Block')); 

이들 모두를 추가 할하지만이 작동하지 않습니다. 배열 요소 그룹을 표시 그룹에 어떻게 추가 할 수 있습니까?

$this->addElement('text', '1', array(
    'label' => 'Text One', 
)); 

$this->addElement('text', '2', array(
    'label' => 'Text Two', 
)); 

$this->addElement('text', '3', array(
    'label' => 'Text Three', 
)); 

을 다음 :

답변

1

이 시도

$this->addDisplayGroup(array('1','2','3'), 'pcinfo', array('disableLoadDefaultDecorators' => true,'legend' => 'Other Block')); 

을 그리고이 라인을 추가하는 것을 잊지 마세요 : 당신은이 블로그를 방문 할 수 있습니다

$this->setDisplayGroupDecorators(array(
     'FormElements', 
     'Fieldset' 
    )); 

을, 당신은 얻을 것이다 위대한 도움 http://zendgeek.blogspot.in/2009/07/zend-form-display-groups-decorators.html