BootstrapUI\View\Helper\FormHelper::staticControl PHP Метод

staticControl() публичный Метод

### Options: - hiddenField - boolean to indicate if you want value for field included in a hidden input. Defaults to true.
public staticControl ( string $fieldName, array $options = [] ) : string
$fieldName string Name of a field, like this "modelname.fieldname"
$options array Array of HTML attributes.
Результат string An HTML text input element.
    public function staticControl($fieldName, array $options = [])
    {
        $options += ['required' => false, 'secure' => true, 'hiddenField' => true];
        $secure = $options['secure'];
        $hiddenField = $options['hiddenField'];
        unset($options['secure'], $options['hiddenField']);
        $options = $this->_initInputField($fieldName, ['secure' => static::SECURE_SKIP] + $options);
        $static = $this->formatTemplate('staticControl', ['content' => $options['val']]);
        if (!$hiddenField) {
            return $static;
        }
        if ($secure === true) {
            $this->_secure(true, $this->_secureFieldName($options['name']), (string) $options['val']);
        }
        $options['type'] = 'hidden';
        return $static . $this->widget('hidden', $options);
    }