addElement('hidden', 'type', ['value' => $this->getType()]); $this->addElement('text', 'name', ['label' => $this->getLabel('name')]); $this->addElement('text', 'location', ['label' => $this->getLabel('location')]); $this->addElement('text', 'result', ['label' => $this->getLabel('result')]); return $this; } private function getLabel($name) { return $this->getRecordType($this->getType(), ['labels', $name]); } public function getType() { return $this->_defaults['type']; } public function setRecordTypes($recordTypes) { $this->_recordTypes = Qs_Array::group($recordTypes, 'type', []); return $this; } public function getRecordType($type, $field = null, $default = null) { $path = [$type]; if (null !== $field) { $path = array_merge($path, (array) $field); } return Qs_Array::get($this->_recordTypes, $path, $default); } }