GcFrontend\Form\Install::license PHP Method

license() public method

License form
public license ( ) : void
return void
    public function license()
    {
        $acceptLicense = new Element\Checkbox('accept-license');
        $acceptLicense->setCheckedValue('1')->setUseHiddenElement(false)->setAttribute('id', 'accept-license')->setAttribute('class', 'input-checkbox');
        $inputFilter = $this->getInputFilter();
        $inputFilter->add(array('name' => 'accept-license', 'required' => true, 'validators' => array(array('name' => 'not_empty'), array('name' => 'greaterthan', 'options' => array('min' => 0)))), 'accept-license');
        $this->add($acceptLicense);
    }

Usage Example

Example #1
0
 /**
  * Display license
  *
  * @return array
  */
 public function licenseAction()
 {
     $this->checkInstall(2);
     $this->installForm->license();
     if ($this->getRequest()->isPost()) {
         $postData = $this->getRequest()->getPost()->toArray();
         $this->installForm->setData($postData);
         if ($this->installForm->isValid()) {
             return $this->redirect()->toRoute('install/check-config');
         }
     }
     $this->layout()->setVariables(array('currentRoute' => $this->getRouteMatch()->getMatchedRouteName()));
     return array('form' => $this->installForm, 'license' => file_get_contents(GC_APPLICATION_PATH . '/LICENSE.txt'));
 }
All Usage Examples Of GcFrontend\Form\Install::license