Gets the form
@param formConfig
@return \Zend\Form\ElementInterface
513196
private function getForm($formConfig)
    {
        $factory = new \Zend\Form\Factory();
        $formElements = $this->serviceLocator->get('FormElementManager');
        $factory->setFormElementManager($formElements);
        $form = $factory->createForm($formConfig);

        return $form;
    }
1204123
protected function formView()
    {
        // get form view
        $formView = $this->RequestContext->getControls()->getControl('action_form_view');

        if($formView == null || empty($formView)) {
            $formView = $this->RequestContext->getControls()->getControl('view');
        }

        return $formView;
    }
474089
public function getFormService()
    {
        if (!array_key_exists('form', $this->services)) {
            $this->services['form'] = new Form($this->httpClient, $this->key);
        }

        return $this->services['form'];
    }
356223
public function formfield_select($config = array())
    {
        $config = new AnConfig($config);

        $config->append(array(
            'class' => 'input-block-level',
            'name' => '',
            'selected' => '',
            'description' => '',
            'id' => '',
            'label' => '',
            'options' => array(),
            'disabled' => false,
        ));

        return $this->_render('formfield_select', $config);
    }
20940
protected function createActivationForm(): FormInterface
    {
        return $this->createFormBuilder(null, ['translation_domain' => 'ngsite_user'])
            ->add(
                'email',
                EmailType::class,
                [
                    'constraints' => [
                        new Constraints\Email(),
                        new Constraints\NotBlank(),
                    ],
                ]
            )->getForm();
    }
672162
public function formfield_custom($config)
    {
        $config = new AnConfig($config);

        $config->append(array(
          'class' => 'input-block-level'
        ));

        return $this->_render('formfield_custom', $config);
    }
1258329
public function getFormConfig()
    {
        $config = $this->getConfigArray('form');

        /**
         * @event cms.theme.extendFormConfig
         * Extend form field configuration supplied by the theme by returning an array.
         *
         * Note if you are planning on using `assetVar` to inject CSS variables from a
         * plugin registration file, make sure the plugin has elevated permissions.
         *
         * Example usage:
         *
         *     Event::listen('cms.theme.extendFormConfig', function ($themeCode, &$config) {
         *          array_set($config, 'tabs.fields.header_color', [
         *              'label'           => 'Header Colour',
         *              'type'            => 'colorpicker',
         *              'availableColors' => [#34495e, #708598, #3498db],
         *              'assetVar'        => 'header-bg',
         *              'tab'             => 'Global'
         *          ]);
         *     });
         *
         */
        Event::fire('cms.theme.extendFormConfig', [$this->getDirName(), &$config]);

        return $config;
    }
397427
private function getFormInterface(FormInterface $form, $id): FormInterface
    {
        $name = $form->getName();
        if ($id === $name)
            return $form;
        if (mb_strpos($id, $name.'_') === 0) {
            $id = mb_substr($id, mb_strlen($name . '_'));
            foreach ($form->all() as $name => $child) {
                if ($id === $name)
                    return $child;
                if (mb_strpos($id, $name.'_') === 0)
                    return $this->getFormInterface($child, $id);
            }
        }
        return $form;
    }
1118020
protected function form()
    {
        return app('antares.form')->of('security', function (FormGrid $form) {

                    $form->name('Security Form');

                    $form->fieldset(function (Fieldset $fieldset) {

                        $fieldset->control('button', 'button')
                                ->attributes(['type' => 'submit', 'class' => 'btn btn-primary',])
                                ->value(trans('antares/foundation::label.save_changes'));
                    });
                });
    }
764404
public function getRootForm()
    {
        $rootRenderable = $this->parentRenderable;
        while ($rootRenderable !== null && !($rootRenderable instanceof FormDefinition)) {
            $rootRenderable = $rootRenderable->getParentRenderable();
        }
        if ($rootRenderable === null) {
            throw new FormDefinitionConsistencyException(sprintf('The form element "%s" is not attached to a parent form.', $this->identifier), 1326803398);
        }

        return $rootRenderable;
    }
817736
public function renderForm( $config = [], $html = [] ) {

		$formView = CodeGenUtil::isAbsolutePath( $this->formView, true ) ? $this->formView : "$this->template/$this->formView";

		return $this->render( $formView, [
			'widget' => $this,
			'infoHtml' => $html[ 'infoHtml' ],
			'fieldsHtml' => $html[ 'fieldsHtml' ]
		] );
	}
1316066
public function getForm() {

		$form = new Form();
		
		// build a select control
		$getSelectControl = function ($property, $field, $values) use ($form) {
			
			$control = $form->addSelect($property)->setListByAssociativeArray($values, $values);
			
			if (static::isNullable($field) or static::isEmptiable($field)) {
				$control->prependEmpty();
			}
			
			return $control;
			
		};

		$properties = $this->getAllProperties();

		// these db column types will go into a textarea
		$textAreaTypes = ['tinytext', 'text', 'mediumtext', 'longtext'];

		foreach ($properties as $propName => $value) {

			$field = static::getMappedField($propName);

			// primary key
			if ($this->isKeyProperty($propName)) {

				$control = $form->addInput($propName)->setType('hidden');

			} else {
				
				$column = static::getColumnType($field);
				
				switch ($this->getPropertyType($propName)) {

					// checkbox
					case 'bool':
						$control = $form->addInput($propName)->setType('bool');
						break;
					
					// date or datetime
					case 'DateTime':
						$type = 'date' == $column->type ? 'date' : 'datetime'; 
						$control = $form->addInput($propName)->setType($type);
						break;

					// number with two decimals
					case 'float':
						$control = $form->addInput($propName)->setType('number')->setStep('0.01');
						break;

					// integer
					case 'int':
						$control = $form->addInput($propName)->setType('number');
						break;

					// multiple select
					case 'csv':
						$control = $getSelectControl($propName, $field, $column->length);
						$control->setMultiple();
						break;
					
					// select, textarea or text
					default:
						if ('enum' == $column->type) {
							$control = $getSelectControl($propName, $field, $column->length);
						} else if ('set' == $column->type) {
							$control = $getSelectControl($propName, $field, $column->length);
							$control->setMultiple();
						} else if (in_array($column->type, $textAreaTypes)) {
							$control = $form->addTextarea($propName);
						} else {
							$control = $form->addInput($propName);
							if (isset($column->length[0])) {
								$control->setMaxLength($column->length[0]);
							}
						}
						break;

				}

			}
			
			// check if is required
			if (!static::isNullable($field) and !static::isEmptiable($field)) {
				$control->setRequired();
			}

			// set the object value
			$control->setValue($value);

		}

		return $form;
		
	}
216185
public function form($form = null)
    {
        if (func_num_args() === 1) {
            $form = $form ?: [];
            $this->_form = $form;
            $this->set($form);
            return $this;
        }
        return $this->_form;
    }
703326
public function createForm()
    {
        $form = new Nette\Application\UI\Form();

        $form->getElementPrototype()->addAttributes(array('class' => 'ajax'));
        $form->setTranslator($this->translator);
        $form->setRenderer(new BootstrapRenderer());

        return $form;
    }
435191
public function form()
    {
        return $this->scaffoldForm()
                    ->without(['slug'])
                    ->update('parent_id', function (FormElement $element) {
                        $control = new Select('parent_id');
                        $control->setOptions(['' => '--Select--'] + pages()->lists());

                        return $element->setInput($control);
                    });
    }
1205033
protected function getFormConfiguration($form_id) {
    $form_configuration = [];

    if (isset($this->configuration['child_forms'][$form_id])) {
      $form_configuration = $this->configuration['child_forms'][$form_id];
    }

    return $form_configuration;
  }
1346742
private function getFormErrors($errors, $formConfig)
    {
        foreach ($errors as $errorKey => $errorValue) {
            foreach ($formConfig['elements'] as $elementKey => $elementValue) {
                if ($elementValue['spec']['name'] == $errorKey && !empty($elementValue['spec']['options']['label'])) {
                    $errors[$elementValue['spec']['options']['label']] = reset($errorValue);
                    unset($errors[$errorKey]);
                }
            }
        }

        return $errors;
    }