Create a submit button element.

@param  string $value
@param  array $options

@return string
969382
public function submit($value = null, $options = [])
    {
        $classes = explode(' ', isset($options['class']) ? $options['class'] : '');

        if ( ! in_array('btn', $classes)) {
            $classes[] = 'btn';
        }
        if ( ! in_array('btn-default', $classes)
            && ! in_array('btn-primary', $classes)
            && ! in_array('btn-success', $classes)
            && ! in_array('btn-info', $classes)
            && ! in_array('btn-warning', $classes)
            && ! in_array('btn-danger', $classes)
            && ! in_array('btn-link', $classes)
        ) {
            $classes[] = 'btn-default';
        }

        $options['class'] = trim(implode(' ', $classes));

        return $this->plainInput('submit', null, $value, $options);
    }
345275
public function filter($value, array $options = [])
    {
        if ( ! is_string($value) || empty(trim($value)))
            return $value;

        $this->checkOptions($options);

        list($currentFormat, $targetFormat) = array_map('trim', $options);

        return DateTime::createFromFormat($currentFormat, $value)->format($targetFormat);
    }
22523
protected function link($value, array $options)
    {
        $return = is_string($value) ? $value : (is_array($value) ? implode(',', $value) : $value);

        if ($options['link']) {
            return sprintf('<a href="%s">%s</a>', $options['link'], $return);
        }

        if ($options['route']) {
            $url = $this->generator->generate($options['route'], $options['parameters'] ?? []);

            return sprintf('<a href="%s">%s</a>', $url, $return);
        }

        return $return;
    }
217126
public function validateCreate(&$submitted, $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateNameCreate();
        $this->validateDestinationCreate();

        return $this->getResult();
    }
693747
public function submit($options = [])
    {
        if (is_string($options)) {
            $options = ['value' => $options];
        }

        if (!Arr::has($options, 'type')) {
            Arr::set($options, 'type', 'submit');
        }

        $input = new Input($this->expression('input'), $options);

        return $input;
    }
1315430
function validate($value, $options = null)
    {
        if (isset($this->_data[$this->name])) {
            $callback = $this->_data[$this->name];
            if (isset($callback[1])) {
                return call_user_func(array($callback[1], $callback[0]), $value, $options);
            } elseif ($this->_BCMode[$this->name]) {
                return $callback[0]('', $value, $options);
            } else {
                return $callback[0]($value, $options);
            }
        } elseif (is_callable($options)) {
            return call_user_func($options, $value);
        } else {
            return true;
        }
    }
912878
public function checkbox(
        $name,
        $value = 1,
        $checked = null,
        $options = []
    ) {
        $checkable = parent::checkbox($name, $value, $checked, $options);

        return array_key_exists('label', $options) ?
            $this->wrapCheckable($options['label'], 'checkbox', $checkable) :
            $checkable;
    }
1211080
protected function renderDropDownList($name, $value, $options)
    {
        if ($this->renderer->isBootstrapTheme()) {
            Html::addCssClass($options, 'form-control');
        }

        $options['tabindex'] = self::TABINDEX;

        return Html::dropDownList($name, $value, $this->prepareItems($this->items), $options);
    }
933923
public static function xss($value, array $options = array()) {
        $options = $options + array('strip' => true);

        $value = str_replace("\0", '', $value);

        if (!$options['strip']) {

            // Remove any attribute starting with on or xmlns
            $value = preg_replace('/\s?(?:on[a-z]+|xmlns)\s?=\s?"(?:.*?)"/isu', '', $value);

            // Remove namespaced elements
            $value = preg_replace('/<\/?\w+:\w+(?:.*?)>/isu', '', $value);

            // Remove really unwanted tags
            do {
                $old = $value;
                $value = preg_replace('/<\/?(?:applet|base|bgsound|embed|frame|frameset|iframe|layer|link|meta|object|script|style|title|xml|audio|video)(?:.*?)>/isu', '', $value);
            } while ($old !== $value);
        }

        return static::html($value, $options);
    }
157380
protected function mapValuesToOptions(array $value, array $options)
    {
        $result = [];
        foreach ($value as $key) {
            $result[] = $this->mapValueToOption($key, $options);
        }
        return $result;
    }
232810
public function &createOption($text = '', $value = '')
    {
        $option = $this->factory->create('Form\Checkbox');

        if ($text) {
            $option->setInner($text);
        }

        if ($value) {
            $option->setValue($value);
        }

        $this->controls[] = $option;

        return $option;
    }
179619
public static function parse($value, $options = [])
    {
        $unserializeHandler = ini_set('unserialize_callback_func', self::class . '::handleUnserializeCallback');
        try {
            if (\PHP_VERSION_ID < 70000) {
                return Thrower::call('unserialize', $value);
            }

            return Thrower::call('unserialize', $value, $options);
        } catch (ParseException $e) {
            throw $e;
        } catch (\Throwable $e) {
        } finally {
            ini_set('unserialize_callback_func', $unserializeHandler);
        }

        throw new ParseException('Error parsing serialized value.', -1, null, 0, $e);
    }
1033273
public function output($inputName, $value = array(), $options = array())
    {
        $view = View::getInstance();
        $view->requireAsset('core/style-customizer');

        $options['inputName'] = $inputName;
        $options = array_merge($options, $value);
        $strOptions = json_encode($options);

        echo '<span class="ccm-style-customizer-display-swatch-wrapper" data-font-selector="' . $inputName . '"></span>';
        echo "<script type=\"text/javascript\">";
        echo "$(function () { $('span[data-font-selector={$inputName}]').concreteTypographySelector({$strOptions}); })";
        echo "</script>";
    }
1225285
public function rawurl($value, array $options, $mode) {
        if ($mode === self::TO && $options['encode']) {
            return rawurlencode($value);
        }

        if ($mode === self::FROM && $options['decode']) {
            return rawurldecode($value);
        }

        return $value;
    }
312213
public static function email($name, $value = null, array $options = [])
    {
        self::exclure($options);

        return self::input('email', $name, $value, $options);
    }
913924
public static function html($value, array $options = array()) {
        $options = $options + array(
            'strip' => true,
            'whitelist' => ''
        );

        if ($options['strip']) {
            $value = strip_tags($value, $options['whitelist']);
        }

        return static::escape($value, $options);
    }
1368194
public function initPasswordReset($value, $options = []) {
		$defaults = [
			'field' => [
				$this->_table->aliasField($this->_field('email')),
				$this->_table->aliasField($this->_field('username'))
			]
		];

		$options = Hash::merge($defaults, $this->_config['initPasswordReset'], $options);
		$result = $this->_getUser($value, $options);

		if (empty($result)) {
			throw new RecordNotFoundException(__d('burzum/user_tools', 'User not found.'));
		}

		$result->set([
			$this->_field('passwordToken') => $this->generateToken($options['tokenLength']),
			$this->_field('passwordTokenExpires') => $this->expirationTime($options['expires'])
		], [
			'guard' => false
		]);

		if (!$this->_table->save($result, ['checkRules' => false])) {
			new RuntimeException('Could not initialize password reset. Data could not be saved.');
		}

		$this->sendPasswordResetToken($result, [
			'to' => $result->get($this->_field('email'))
		]);
	}