Код: Выделить всё
public function init()
{
$this->setMethod('post')
->setAttrib('id', 'userGroup');
//get the stuff out of the db
$group = new Application_Model_GroupMapper();
$disciplines = $group->fetchAll(array(
'type' => 'discipline',
'orderby' => 'g.name',
'sort' => 'ASC'
));
$disciplineFields = array();
foreach($disciplines as $row):
$el = $row->name;
$this->addElement('checkbox', $el, array(
'required' => false,
'label' => $el,
'class' => 'inputCheckbox'
));
$this->$el->setCheckedValue('true');
$this->$el->setUnCheckedValue('false');
array_push($disciplineFields,$el);
endforeach;
//discipline information
$this->addDisplayGroup(
$disciplineFields,
'disciplineInformation',
array('legend' => 'Discipline')
);
Для группы отображения не указаны допустимые элементы
Ну, это странно, потому что когда я подсчитываю свой массив $disciplineFields, он имеет 4 элемента и поля отображаются, когда я удаляю displayGroup линия. Также, когда я изменяю строку displayGroup на
Код: Выделить всё
//discipline information
$this->addDisplayGroup(
array('Schipper'), //this is one of the records in the database
'disciplineInformation',
array('legend' => 'Discipline')
);
Почему это не работает? Что я делаю не так?
Подробнее здесь: https://stackoverflow.com/questions/603 ... ld-in-zend
Мобильная версия