New form structure

@return array
512494
public function getNewStructure()
    {
        return [
            [
                "type"            => "singleLine",
                "fieldID"         => $this->prefix . "title",
                "tabID"           => trans("Translations"),
                "label"           => trans("HCGalleries::galleries.title"),
                "required"        => 1,
                "requiredVisible" => 1,
                "multiLanguage"   => 1,
            ],
            [
                "type"          => "richTextArea",
                "fieldID"       => $this->prefix . "content",
                "tabID"         => trans("Translations"),
                "label"         => trans("HCGalleries::galleries.content"),
                "multiLanguage" => 1,
            ],
            [
                "type"          => "singleLine",
                "fieldID"       => $this->prefix . "location",
                "tabID"         => trans("General"),
                "label"         => trans("HCGalleries::galleries.location"),
                "multiLanguage" => 1,
            ],
            [
                "type"            => "dateTimePicker",
                "properties"      => [
                    "format" => "YYYY-MM-DD HH:mm:ss",
                ],
                "fieldID"         => $this->prefix . "publish_at",
                "tabID"           => trans("General"),
                "label"           => trans("HCGalleries::galleries.publish_at"),
                "requiredVisible" => 1,
            ], [
                "type"       => "dateTimePicker",
                "properties" => [
                    "format" => "YYYY-MM-DD HH:mm:ss",
                ],
                "fieldID"    => $this->prefix . "expires_at",
                "tabID"      => trans("General"),
                "label"      => trans("HCGalleries::galleries.expires_at"),


            ],
            [
                "type"      => "resource",
                "fieldID"   => $this->prefix . "images",
                "tabID"     => trans("Resources"),
                "uploadURL" => route("admin.api.resources"),
                "viewURL"   => route("resource.get", ['/']),
                "sortable"  => 1,
            ],
        ];
    }
77330
public function newAction()
    {
        $entity = new ProductOrderStatus();
        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
654170
protected function buildForm()
    {
        $this->form = Yii::createObject(array_merge([
            'scenario' => $this->scenario,
            'parent_id' => $this->parent_id,
            'parentTariff' => $this->parentTariff,
            'tariff' => $this->tariff,
        ], $this->getFormOptions()));
    }
271967
protected function _prepareForm()
    {
        $form = $this->formFactory->create();
        $this->setForm($form);

        /** @var \Mirasvit\Blog\Model\Category $category */
        $category = $this->registry->registry('current_model');

        $fieldset = $form->addFieldset('edit_fieldset', [
            'legend' => __('Search Engine Optimization')
        ]);

        $fieldset->addField('url_key', 'text', [
            'label' => __('URL Key'),
            'name'  => 'url_key',
            'value' => $category->getUrlKey(),
        ]);

        $fieldset->addField('meta_title', 'text', [
            'label' => __('Meta Title'),
            'name'  => 'meta_title',
            'value' => $category->getMetaTitle(),
        ]);

        $fieldset->addField('meta_description', 'textarea', [
            'label' => __('Meta Description'),
            'name'  => 'meta_description',
            'value' => $category->getMetaDescription(),
        ]);

        $fieldset->addField('meta_keywords', 'textarea', [
            'label' => __('Meta Keywords'),
            'name'  => 'meta_keywords',
            'value' => $category->getMetaKeywords(),
        ]);

        return parent::_prepareForm();
    }
1365307
public function newAction()
    {
        $entity = new Page();
        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
111934
public function makeFormElements()
    {
        $formMethods = array();

        foreach($this->cache->getFields() as $name => $type)
        {
            $formalName = ucwords($name);

            // TODO: add remaining types
            switch($type)
            {
                case 'integer':
                   $element = "{{ Form::input('number', '$name') }}";
                    break;

                case 'text':
                    $element = "{{ Form::textarea('$name') }}";
                    break;

                case 'boolean':
                    $element = "{{ Form::checkbox('$name') }}";
                    break;

                default:
                    $element = "{{ Form::text('$name') }}";
                    break;
            }

            // Now that we have the correct $element,
            // We can build up the HTML fragment
            $frag = <<<EOT
        <li>
            {{ Form::label('$name', '$formalName:') }}
            $element
        </li>

EOT;

            $formMethods[] = $frag;
        }

        return implode(PHP_EOL, $formMethods);
    }
419140
public function newAction()
    {
        $entity = new Collection();
        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
75471
public function newAction()
    {
        $entity = new Tag();
        $form   = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }
949586
public function getForms()
	{		
		$arrForms = array();
		$objForms = $this->Database->execute("SELECT id, title FROM tl_form ORDER BY title");
		
		while ($objForms->next())
		{
			$arrForms[$objForms->id] = $objForms->title . ' (ID ' . $objForms->id . ')';
		}
		
		return $arrForms;
	}
1368233
protected function createComponentRegisterAdministratorForm(): Form
	{
		$form = $this->formFactory->create();
		$form->addProtection();

		$form->addText('username', 'cms.user.username')
			->setRequired();
		$form->addText('firstName', 'cms.user.firstName');
		$form->addText('surname', 'cms.user.surname');
		$form->addText('email', 'cms.user.email')
			->setRequired()
			->addRule(Form::EMAIL);

		$form->addPassword('password', 'cms.user.newPassword')
			->setRequired()
			->addRule(Form::MIN_LENGTH, null, $this->minPasswordLength);
		$form->addPassword('passwordVerify', 'cms.user.passwordVerify')
			->setRequired()
			->addRule(Form::EQUAL, null, $form['password']);

		$form->addSubmit('create', 'form.save');

		$form->onSuccess[] = [$this, 'registerAdministratorFormSucceeded'];

		return $form;
	}
1348027
public function create()
    {
        $model = new ModuleRow();
        $form  = $this->form($model);
        if (app('request')->isMethod('post')) {
            if (!$form->isValid()) {
                return ['errors' => $form->getMessageBag()];
            }
        }
        return ['form' => $form];
    }
854333
public function form()
    {
        return Menu::form(function (Form $form) {
            $form->display('id', 'ID');

            $form->select('parent_id', trans('merchant.parent_id'))->options(Menu::selectOptions());
            $form->text('title', trans('merchant.title'))->rules('required');
            $form->icon('icon', trans('merchant.icon'))->default('fa-bars')->rules('required')->help($this->iconHelp());
            $form->text('uri', trans('merchant.uri'));
            $form->multipleSelect('roles', trans('merchant.roles'))->options(Role::all()->pluck('name', 'id'));

            $form->display('created_at', trans('merchant.created_at'));
            $form->display('updated_at', trans('merchant.updated_at'));
        });
    }
809772
public function newAction()
    {
        $productitemfielddata = new ProductItemFieldData();
        $form = $this->createForm($this->get("amulen.shop.form.product.item.field.data"), $productitemfielddata);

        return array(
            'productitemfielddata' => $productitemfielddata,
            'form' => $form->createView(),
        );
    }
962635
private function buildEditForm()
    {
        $form = '';
        foreach ($this->fields as $field) {
            $title = addslashes($field->label);
            $label = $field->title;
            if (in_array($field->validation,
                    $this->starred) && $field->type != 'password' && $field->type != 'file' && $field->type != 'photo'
            ) {
                $title .= '*';
            }
            if ($field->type == 'relationship') {
                $label = $field->relationship_name . '_id';
            }
            if ($field->type == 'checkbox') {
                $field->default = '$' . $this->model . '->' . $label . ' == 1';
            }
            $temp = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $field->type);
            $temp = str_replace([
                'old(\'$LABEL$\')',
                '$LABEL$',
                '$TITLE$',
                '$VALUE$',
                '$STATE$',
                '$SELECT$',
                '$TEXTEDITOR$',
                '$HELPER$',
                '$WIDTH$',
                '$HEIGHT$',
            ], [
                'old(\'$LABEL$\',$' . $this->resource . '->' . $label . ')',
                $label,
                $title,
                $field->type != 'radio' ?
                    $field->value != '' ? ', "' . $field->value . '"' : ''
                    : "'$field->value'",
                $field->default,
                '$' . $field->relationship_name,
                $field->texteditor == 1 ? ' ckeditor' : '',
                $this->helper($field->helper),
                $field->dimension_w,
                $field->dimension_h,
            ], $temp);
            $form .= $temp;
        }
        $this->formFieldsEdit = $form;
    }
128046
protected function createComponentEditForm(): Form
	{
		$form = new Form;
		$form->setAjaxRequest();

		$form->addHidden('id');

		$form->addTextArea('content')
			->setAttribute('autofocus', true);

		$form->addSubmit('save', $this->translator->translate('nattreid.fileManager.save'));

		$form->onSuccess[] = [$this, 'editFormSucceeded'];

		return $form;
	}
825383
public function newAction() {

        $entity = new Role();

        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
1194851
public function addAction()
    {
        $this->registerBreadcrubms()->addItem($this->get("translator")->trans("Add"));

        $entity = $this->getNewEntity();
        $form = $this->createCreateForm($entity);

        return [
            'entity' => $entity,
            'form' => $form->createView(),
        ];
    }