addElement('radio', 'type', array( 'label' => 'Meeting Summary Type', 'required' => true, 'multiOptions' => $obj->getMeetingSummaryType4Select(), 'separator' => '   ', )); $this->addElement('date', 'date', array('label' => 'Publication Date', 'required' => true)); $this->addElement('text', 'title', array('label' => 'Title', 'required' => true)); $validator = new \Zend_Validate_File_Extension(['pdf']); $validator->setMessage('Selected file format should be .pdf', \Zend_Validate_File_Extension::FALSE_EXTENSION); $this->addElement( 'extendedFile', 'file', array( 'label' => 'File', 'description' => 'Allowed file format: pdf', 'required' => true, 'validators' => [$validator], ) ); $this->getElement('file')->addValidator('File_Extension', true, array('pdf')); $this->addElement('checkbox', 'enabled', array('label' => 'Show on user end', 'decoration' => 'simple')); return $this; } }