Will generate the stripe form
@return string the generated stripe's modal form
436341
private function generateStripeForm() {
        return Html::beginForm($this->action, 'POST', $this->formOptions)
            . $this->generateScriptTag()
            . Html::endForm();
    }
227535
public function CartForm()
    {
        $fields = new FieldList();

        $actions = new FieldList(
            FormAction::create('doUpdate', _t('Checkout.UpdateCart', 'Update Cart'))
                ->addExtraClass('btn')
                ->addExtraClass('btn-blue btn-info')
        );

        $form = Form::create($this, "CartForm", $fields, $actions)
            ->addExtraClass("forms")
            ->setTemplate("ShoppingCartForm");

        $this->extend("updateCartForm", $form);

        return $form;
    }
676078
private function generateScriptTag() {
        return Html::script('', [
                    'src' => $this->stripeJs,
                    'data-key' => Yii::$app->stripe->publicKey,
                    'data-amount' => $this->amount,
                    'data-name' => $this->name,
                    'data-description' => $this->description,
                    'data-image' => $this->image,
                    'data-currency' => $this->currency,
                    'data-panel-label' => $this->panelLabel,
                    'data-zip-code' => $this->validateZipCode,
                    'data-email' => $this->userEmail,
                    'data-label' => $this->label,
                    'data-allow-remember-me' => $this->allowRemember,
                    'data-billing-address' => $this->collectBillingAddress,
                    'class' => self::BUTTON_CLASS,
        ]);
    }
781488
public function generate()
    {
        return sprintf(
            '<input type="hidden" id="ctrl_%s" name="%s" value="%s" /><div%s>%s</div>',
            $this->strId,
            $this->strName,
            StringUtil::specialchars($this->label ?: $this->varValue),
            $this->style ? ' style="' . $this->style . '"' : '',
            $this->label
        );
    }
153426
public function createForm()
    {
        $form = '
            <form action="'.$this->_setEnvironment.'" method="post" id="'.$this->_setIdForm.'" name="'.$this->_setNameForm.'" >
                <input type="hidden" name="Ds_MerchantParameters" value="'.$this->generateMerchantParameters().'"/>
                <input type="hidden" name="Ds_Signature" value="'.$this->_setSignature.'"/>
                <input type="hidden" name="Ds_SignatureVersion" value="'.$this->_setVersion.'"/>
                <input type="submit" name="'.$this->_setNameSubmit.'" id="'.$this->_setIdSubmit.'" value="'.$this->_setValueSubmit.'" '.($this->_setStyleSubmit != '' ? ' style="'.$this->_setStyleSubmit.'"' : '').' '.($this->_setClassSubmit != '' ? ' class="'.$this->_setClassSubmit.'"' : '').'>
            </form>
        ';

        return $form;
    }
143692
public function generate(): string
    {
        $condID = (string)$this->attributes['data-conditional-id'];
        $getState = $this->vHandler->get->get($condID.'_state', Variables::TYPE_INT) == 1;
        $postState = $this->vHandler->post->get($condID.'_state', Variables::TYPE_INT) == 1;
        $visible = $getState || $postState;
        $this->attributes['class'] .= $visible === true ? ' visible' : '';

        $elements = [];
        $elements[] = Controlls\Text::inputHidden($condID.'_state', (int)$visible, ['method-get' => true, 'id' => '']);
        foreach ($this->elements as $element) {
            /** @noinspection PhpUndefinedMethodInspection */
            $elements[] = $element->generate();
        }
        return Tags::div($elements, $this->attributes);
    }
1123244
public function formAction()
    {
        $isNew     = 'new' == $this->params('mode');
        $form      = $this->formManager->get('Auth/Group', array('mode' => $this->params('mode')));
        $repository = $this->repositories->get('Auth/Group');
        
        if ($isNew) {
            $group = new \Auth\Entity\Group();
        } else {
            if ($this->getRequest()->isPost()) {
                $data = $this->params()->fromPost('data');
                $id   = isset($data['id']) ? $data['id'] : false;
            } else {
                $id   = $this->params()->fromQuery('id', false);
            }
            if (!$id) {
                throw new \RuntimeException('No id.');
            }
            $group = $repository->find($id);
        }
        
        $form->bind($group);
        if ($this->getRequest()->isPost()) {
            $form->setData($_POST);
            $isOk      = $form->isValid();
            $isUsersOk = !empty($group->users);
             
            if ($isOk) {
                // We have to check here, if there are any users provided
                // as InputFilter does not allow "required" to be set on fieldsets.
                if ($isUsersOk) {
                    if ($isNew) {
                        $user    = $this->auth()->getUser();
                        $group->setOwner($user);
                        $groups  = $user->getGroups();
                        $message = /*@translate*/ 'Group created';
                        $groups->add($group);
                    } else {
                        $message = /*@translate*/ 'Group updated';
                    }
                    
                    $this->notification()->success($message);
                    return $this->redirect()->toRoute('lang/my-groups');
                }
            }
            if (!$isUsersOk) {
                $form->get('data')->get('users')->setNoUsersError(true);
            }
            $this->notification()->error(/*@translate*/ 'Changes not saved.');
        }
        
        return array(
            'form' => $form,
            'isNew' => $isNew,
        );
    }
820002
public function renderBegin()
	{
		if($this->getParent() instanceof self)
			return '';
		else
		{
			$options=$this->activeForm;
			if(isset($options['class']))
			{
				$class=$options['class'];
				unset($options['class']);
			}
			else
				$class='CActiveForm';
			$options['action']=$this->action;
			$options['method']=$this->method;
			if(isset($options['htmlOptions']))
			{
				foreach($this->attributes as $name=>$value)
					$options['htmlOptions'][$name]=$value;
			}
			else
				$options['htmlOptions']=$this->attributes;
			ob_start();
			$this->_activeForm=$this->getOwner()->beginWidget($class, $options);
			return ob_get_clean() . "<div style=\"display:none\">".CHtml::hiddenField($this->getUniqueID(),1)."</div>\n";
		}
	}
1285665
protected function get_module_form() {
        global $CFG, $PAGE;

        if ($this->_moduleform) {
            return $this->_moduleform;
        }

        $cm = reset($this->cms);
        $course = $this->course;
        $modname = $cm->modname;

        $modmoodleform = "$CFG->dirroot/mod/$modname/mod_form.php";
        if (file_exists($modmoodleform)) {
            require_once($modmoodleform);
        } else {
            print_error('noformdesc');
        }

        list($cmrec, $context, $module, $data, $cw) = get_moduleinfo_data($cm, $course);
        $data->return = 0;
        $data->sr = 0;
        $data->update = $modname;

        // Initialise the form but discard all JS requirements it adds, our form has already added them.
        $mformclassname = 'mod_'.$modname.'_mod_form';
        $PAGE->start_collecting_javascript_requirements();
        $this->_moduleform = new $mformclassname($data, 0, $cmrec, $course);
        $PAGE->end_collecting_javascript_requirements();

        return $this->_moduleform;
    }
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);
                    });
    }
174464
public function generate()
	{
		if (TL_MODE === 'BE') {
			return parent::generate();
		}

		$parentKey = ($this->arrData['ptable'] ?: 'tl_article') . '__' . $this->arrData['pid'];
		if (isset($GLOBALS['TL_RS_COLUMNS'][$parentKey])) {
			if (!$GLOBALS['TL_RS_COLUMNS'][$parentKey]['active']) {
				trigger_error('Missing column stop element before column wrapper stop element ID ' . $this->id . '.', E_USER_WARNING);
			}
			unset($GLOBALS['TL_RS_COLUMNS'][$parentKey]);
		}
		else {
			trigger_error('Missing column wrapper start element before column wrapper stop element ID ' . $this->id . '.', E_USER_WARNING);
		}

		$htmlSuffix = '';

		if (!empty($GLOBALS['TL_RS_COLUMNS_STACK'][$parentKey])) {
			$GLOBALS['TL_RS_COLUMNS'][$parentKey] = array_pop($GLOBALS['TL_RS_COLUMNS_STACK'][$parentKey]);
			if ($GLOBALS['TL_RS_COLUMNS'][$parentKey]['active']) {
				$htmlSuffix .= '</div>';
			}
		}

		return parent::generate() . $htmlSuffix;
	}
332522
public function generate()
    {
        $form = collect([]);

        // Loop all the the fields in the schema
        foreach ($this->schema->all() as $name => $input) {

            // Skip the one that don't have a `form` definition
            if (isset($input['form'])) {

                // Get the value from the data
                $value = isset($this->data[$name]) ? $this->data[$name] : null;

                // Add the namespace to the name if it's defined
                $name = ($this->formNamespace != '') ? $this->formNamespace.'['.$name.']' : $name;

                // Get the element class and make sure it exist
                $type = (isset($input['form']['type'])) ? $input['form']['type'] : 'text';
                $type = 'UserFrosting\\Sprinkle\\FormGenerator\\Element\\'.Str::studly($type);

                // If class doesn't esist, default to Text element
                if (!class_exists($type)) {
                    $type = 'UserFrosting\\Sprinkle\\FormGenerator\\Element\\Text';
                }

                // Create a new instance
                $element = new $type($name, $input['form'], $value);

                // Push data to `$form`
                $form->put($name, $element->parse());
            }
        }

        return $form->toArray();
    }
1004960
public function render(Form $form, $mode = null) {
		$form->getElementPrototype()->addClass("form-horizontal");
		
		foreach($form->getControls() as $control) {
			if($control instanceof Checkbox || $control instanceof CheckboxList || $control instanceof RadioList) {
				$control->getSeparatorPrototype()->setName(null);
			}
			if($control instanceof Checkbox) {
				$control->getLabelPrototype()->addClass("checkbox-inline");
			}
			if($control instanceof CheckboxList) {
				$control->getItemLabelPrototype()->addClass("checkbox-inline");
			}
			if($control instanceof RadioList) {
				$control->getItemLabelPrototype()->addClass("radio-inline");
			}
			if($control instanceof TextBase || $control instanceof SelectBox || $control instanceof MultiSelectBox) {
				$control->getControlPrototype()->addClass("form-control");
			}
			if($control instanceof TextArea) {
				$control->getControlPrototype()->setAttribute("rows", 4);
			}
		}
		
		return parent::render($form, $mode);
	}
577360
public function buildForm()
    {
        $orderId = $this
            ->paymentBridge
            ->getOrderId();

        $extraData = $this->paymentBridge->getExtraData();
        $formBuilder = $this
            ->formFactory
            ->createNamedBuilder(null);

        if (array_key_exists('transaction_type', $extraData)) {
            $Ds_Merchant_TransactionType = $extraData['transaction_type'];
        } else {
            $Ds_Merchant_TransactionType = '0';
        }

        /**
         * Creates the return route for Redsys.
         */
        $Ds_Merchant_MerchantURL = $this
            ->urlFactory
            ->getReturnRedsysUrl();

        /**
         * Creates the return route, when coming back
         * from Redsys web checkout and proccess is Ok.
         */
        $Ds_Merchant_UrlOK = $this
            ->urlFactory
            ->getReturnUrlOkForOrderId($orderId);

        /**
         * Creates the cancel payment route, when coming back
         * from Redsys web checkout and proccess is error.
         */
        $Ds_Merchant_UrlKO = $this
            ->urlFactory
            ->getReturnUrlKoForOrderId($orderId);

        /**
         * Creates the merchant signature.
         */
        $Ds_Merchant_Amount = $this->paymentBridge->getAmount();
        $Ds_Merchant_Order = $this->formatOrderNumber(
            $this
                ->paymentBridge
                ->getOrderNumber()
        );
        $Ds_Merchant_MerchantCode = $this->merchantCode;
        $Ds_Merchant_Currency = $this->getCurrencyCodeByIso($this->paymentBridge->getCurrency());
        $Ds_Merchant_MerchantSignature = $this->shopSignature(
            $Ds_Merchant_Amount,
            $Ds_Merchant_Order,
            $Ds_Merchant_MerchantCode,
            $Ds_Merchant_Currency,
            $Ds_Merchant_TransactionType,
            $Ds_Merchant_MerchantURL,
            $this->secretKey
        );

        $Ds_Merchant_Terminal = $extraData['terminal'];

        $formBuilder
            ->setAction($this->url)
            ->setMethod('POST')
            ->add('Ds_Merchant_Amount', 'hidden', [
                'data' => $Ds_Merchant_Amount,
            ])
            ->add('Ds_Merchant_MerchantSignature', 'hidden', [
                'data' => $Ds_Merchant_MerchantSignature,
            ])
            ->add('Ds_Merchant_MerchantCode', 'hidden', [
                'data' => $this->merchantCode,
            ])
            ->add('Ds_Merchant_Currency', 'hidden', [
                'data' => $Ds_Merchant_Currency,
            ])
            ->add('Ds_Merchant_Terminal', 'hidden', [
                'data' => $Ds_Merchant_Terminal,
            ])
            ->add('Ds_Merchant_Order', 'hidden', [
                'data' => $Ds_Merchant_Order,
            ])
            ->add('Ds_Merchant_MerchantURL', 'hidden', [
                'data' => $Ds_Merchant_MerchantURL,
            ])
            ->add('Ds_Merchant_UrlOK', 'hidden', [
                'data' => $Ds_Merchant_UrlOK,
            ])
            ->add('Ds_Merchant_UrlKO', 'hidden', [
                'data' => $Ds_Merchant_UrlKO,
            ]);

        /**
         * Optional form fields.
         */
        if (array_key_exists('transaction_type', $extraData)) {
            $formBuilder->add('Ds_Merchant_TransactionType', 'hidden', [
                'data' => $Ds_Merchant_TransactionType,
            ]);
        }

        if (array_key_exists('product_description', $extraData)) {
            $formBuilder->add('Ds_Merchant_ProductDescription', 'hidden', [
                'data' => $extraData['product_description'],
            ]);
        }

        if (array_key_exists('merchant_titular', $extraData)) {
            $formBuilder->add('Ds_Merchant_Titular', 'hidden', [
                'data' => $extraData['merchant_titular'],
            ]);
        }

        if (array_key_exists('merchant_name', $extraData)) {
            $formBuilder->add('Ds_Merchant_MerchantName', 'hidden', [
                'data' => $extraData['merchant_name'],
            ]);
        }

        if (array_key_exists('merchant_data', $extraData)) {
            $formBuilder->add('Ds_Merchant_MerchantData', 'hidden', [
                'data' => $extraData['merchant_data'],
            ]);
        }

        return $formBuilder
            ->getForm()
            ->createView();
    }
1140704
public function LinkForm()
    {
        $this->getLinkObject();

        $action = FormAction::create('doSaveLink', _t('Linkable.SAVE', 'Save'))
            ->setUseButtonTag('true');

        if (!$this->isFrontend) {
            $action
                ->addExtraClass('ss-ui-action-constructive')
                ->setAttribute('data-icon', 'accept');
        }

        $link = null;
        if ($linkID = (int)$this->request->getVar('LinkID')) {
            $link = Link::get()->byID($linkID);
        }

        $link = $link ? $link : singleton(Link::class);
        $link->setAllowedTypes($this->getAllowedTypes());

        /** @var $fields FieldList */
        $fields = $link->getCMSFields();

        $title = $link ? _t('Linkable.EDITLINK', 'Edit Link') : _t('Linkable.ADDLINK', 'Add Link');
        $fields->insertBefore(
            _t('Linkable.TITLE', 'Title'), HeaderField::create('LinkHeader', $title)
        );

        $actions = FieldList::create($action);
        $form = Form::create($this, 'LinkForm', $fields, $actions);

        if ($link) {
            $form->loadDataFrom($link);
            $fields->push(HiddenField::create('LinkID', 'LinkID', $link->ID));
        }

        $this->owner->extend('updateLinkForm', $form);

        return $form;
    }
82
public function modal_template() {

		$output = '<script type="text/html" id="' . esc_attr( $this->id() ) . '-components">';
		foreach ( $this->modals as $modal ) {

			$label         = $modal->struct['label'];
			$data          = $modal->get_data();
			$data_template = $this->drill_in( $data[ $modal->slug ], '{{@root' );
			$modal->set_data( array( $modal->slug => $data_template ) );

			$modal->render();

			$setup = null;
			if ( count( $modal->child ) > 1 ) {
				$setup = ' data-setup="true" ';
			}

			$output .= '<button type="button" class="button uix-component-trigger" style="margin:12px 0 0 12px;" data-label="' . esc_attr( $modal->attributes['data-title'] ) . '" data-type="' . $modal->slug . '" ' . $setup . ' data-id="' . esc_attr( $modal->id() ) . '">' . $label . '</button> ';

		}
		$output .= '</script>';

		return $output;
	}
994560
private function getForm()
    {
        $coreConfig = $this->getServiceLocator()->get('MelisCoreConfig');
        $form = $coreConfig->getItem('melis_engine_setup/forms/melis_installer_platform_data');

        $factory = new \Zend\Form\Factory();
        $formElements = $this->serviceLocator->get('FormElementManager');
        $factory->setFormElementManager($formElements);
        $form = $factory->createForm($form);

        return $form;

    }