GcContent\Form\DocumentInformation::init PHP Method

init() public method

Initialize Form
public init ( ) : void
return void
    public function init()
    {
        $inputFilterFactory = new InputFilterFactory();
        $inputFilter = $inputFilterFactory->createInputFilter(array('document-name' => array('name' => 'document-name', 'required' => true, 'validators' => array(array('name' => 'not_empty'))), 'document-url_key' => array('name' => 'document-url_key', 'required' => false, 'allow_empty' => true, 'validators' => array(array('name' => 'regex', 'options' => array('pattern' => parent::IDENTIFIER_PATTERN)), array('name' => 'db\\no_record_exists', 'options' => array('table' => 'document', 'field' => 'url_key', 'adapter' => $this->getAdapter()))))));
        $this->setInputFilter($inputFilter);
        $name = new Element\Text('document-name');
        $name->setLabel('Name')->setLabelAttributes(array('class' => 'required control-label'))->setAttribute('id', 'name')->setAttribute('class', 'form-control');
        $urlKey = new Element\Text('document-url_key');
        $urlKey->setLabel('Url key')->setLabelAttributes(array('class' => 'required control-label'))->setAttribute('id', 'url_key')->setAttribute('class', 'form-control');
        $documentType = new Element\Select('document_type');
        $documentType->setLabel('Document Type')->setLabelAttributes(array('class' => 'required control-label'))->setAttribute('id', 'document_type')->setAttribute('class', 'form-control')->setValueOptions(array('' => 'Select document type'));
        $parent = new Element\Hidden('parent');
        $this->add($name);
        $this->add($urlKey);
        $this->add($documentType);
        $this->add($parent);
    }
DocumentInformation