Create Form with Bootstrap styling
@param bool|true $secured
@return Form|IForm
338713
public function createBootstrap($secured = true)
	{
		$form = $this->create($secured);
		$form->setRenderer(new Bootstrap3Renderer());
		return $form;
	}
721735
private function signOn($credentials, $secureCookie = '')
    {
        //Set secure cookie
        if ('' === $secureCookie) {
            $secureCookie = is_ssl();
        }

        //Filter secure cookie
        $secureCookie = apply_filters( 'secure_signon_cookie', $secureCookie, $credentials );

        //Pass it on as a global
        global $auth_secure_cookie;
        $auth_secure_cookie = $secureCookie;

        //Filter auth cookie global
        add_filter('authenticate', 'wp_authenticate_cookie', 30, 3);

        // Get user object
        $user = get_user_by('login', $credentials['user_login']);

        //Set authentication cookie
        wp_set_auth_cookie($user->ID, $credentials['remember'], $secureCookie);

        //Proceed with normal login process
        do_action('wp_login', $credentials['user_login'], $user);
    }
1190757
public static function makeIf($condition, $options)
    {
        if (value($condition)) {
            return static::make($options);
        }

        return static::make()->authorized(false);
    }
715305
public static function hash($data, bool $secure = false): string
    {
        return hash(self::getAlgo($secure), (string) $data);
    }
132985
public function secure($secure = null)
    {
        if ($secure !== null) {
            $this->secure = (bool) $secure;
        }

        return (bool) $this->secure;
    }
833511
protected function getScheme( $secure )
	{
		if ( is_null( $secure ) )
		{
			if ( is_null( $this->cachedSchema ) )
			{
				$this->cachedSchema = $this->forceSchema ?: $this->request->getScheme() . '://';
			}

			return $this->cachedSchema;
		}

		return $secure ? 'https://' : 'http://';
	}
1371691
public function createBootstrapStacked($secured = true)
	{
		$form = $this->create($secured);
		$form->setRenderer(new Bootstrap3StackRenderer());
		return $form;
	}
98356
protected function prepareForm(Form $form)
	{
		$form->getElementPrototype()->class[] = 'form-horizontal';
		$translator = $form->getTranslator();
		foreach ($form->controls as $control) {
			/** @var BaseControl $control */
			if ($control instanceof HiddenField) {
				continue;
			} elseif ($control instanceof Button) {
				$control->controlPrototype->class[] = "btn-block btn-lg";
			} else {
				if ($control->getLabel()) {
					$control->setAttribute('placeholder', $control->caption);
					if (empty($control->controlPrototype->attrs['title'])) {
						$control->setAttribute('title', $translator ? $translator->translate($control->caption) : $control->caption);
					}
					$control->getLabelPrototype()->attrs["style"] = "display:none";
				}
			}
		}
		BootstrapHelper::ApplyBootstrapToControls($form);
	}
1008600
public function to($path, $status = 302, $headers = array(), $secure = null)
    {
        $path = $this->generator->to($path, array(), $secure);

        return $this->createRedirect($path, $status, $headers);
    }
993471
protected function getScheme($secure)
  {
    if (is_null($secure)) {
        return $this->forceSchema ?: $this->plugin->make('request')->getScheme().'://';
    }

    return $secure ? 'https://' : 'http://';
  }
61623
protected function createComponentPasswordForm(): Form
	{
		$form = $this->formFactory->create();
		$form->addProtection();

		$form->addText('username', 'cms.user.username')
			->setDisabled()
			->setDefaultValue($this->currentUser->username);

		if ($this->configurator->sendNewUserPassword) {
			$form->addCheckbox('generatePassword', 'cms.user.generatePassword')
				->addCondition($form::EQUAL, false)
				->toggle('password')
				->toggle('passwordVerify');
		} else {
			$form->addHidden('generatePassword', false);
		}

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

		$form->addSubmit('save', 'form.save');
		$form->addLink('back', 'form.back', $this->getBacklink());

		$form->onSuccess[] = [$this, 'passwordFormSucceeded'];
		return $form;
	}
293615
protected function createComponentForgottenPasswordForm(): Form
	{
		$form = $this->formFactory->create();
		$form->addProtection();

		$form->addText('usernameOrEmail', 'cms.user.usernameOrEmail')
			->setRequired();

		$form->addSubmit('send', 'form.send');

		$form->addLink('back', 'form.back', $this->link('in'));

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

		return $form;
	}
31675
public function formatScheme($secure)
    {
        if (!is_null($secure)) {
            return $secure ? 'https://' : 'http://';
        }
        if (is_null($this->cachedSchema)) {
            $this->cachedSchema = $this->forceScheme ?: $this->getContext()->getScheme() . '://';
        }
        return $this->cachedSchema;
    }
192348
public function assetFrom($root, $path, $secure = null)
    {
        // Once we get the root URL, we will check to see if it contains an index.php
        // file in the paths. If it does, we will remove it since it is not needed
        // for asset paths, but only for routes to endpoints in the application.
        $root = $this->getRootUrl($this->formatScheme($secure), $root);

        return $this->removeIndex($root).'/'.trim($path, '/');
    }
796595
public function formatScheme($secure = null)
    {
        if (! is_null($secure)) {
            return $secure ? 'https://' : 'http://';
        }

        if (is_null($this->cachedScheme)) {
            $this->cachedScheme = $this->forceScheme ?: $this->request->getScheme().'://';
        }

        return $this->cachedScheme;
    }
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;
    }
1189240
protected function createForm($options = null)
    {
        if ($this->useTabbedForm) {
            return new \Gems_TabForm($options);
        }
        if (\MUtil_Bootstrap::enabled()) {
            if (!isset($options['class'])) {
                $options['class'] = 'form-horizontal';
            }

            if (!isset($options['role'])) {
                $options['role'] = 'form';
            }
        }
        return new \Gems_Form($options);
    }