public function staticControl($fieldName, array $options = [])
    {
        $options += [
            'escape' => true,
            '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
        );

        $content = $options['escape'] ? h($options['val']) : $options['val'];
        $static = $this->formatTemplate('staticControl', [
            'content' => $content
        ]);

        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);
    }
public function staticControl($fieldName, array $options = [])
    {
        $options += [
            'escape' => true,
            '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
        );

        $content = $options['escape'] ? h($options['val']) : $options['val'];
        $static = $this->formatTemplate('staticControl', [
            'content' => $content
        ]);

        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);
    }
public function staticControl ( $ fieldName , array $ options = [ ] ) { $ options += [ 'escape' => true , '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 ) ; $ content = $ options [ 'escape' ] ? h ( $ options [ 'val' ] ) : $ options [ 'val' ] ; $ static = $ this -> formatTemplate ( 'staticControl' , [ 'content' => $ content ] ) ; 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 ) ; }
Used to place plain text next to label within a form.

### Options:

- `hiddenField` - boolean to indicate if you want value for field included
in a hidden input. Defaults to true.

@param string $fieldName Name of a field, like this "modelname.fieldname"
@param array $options Array of HTML attributes.
@return string An HTML text input element.
Used to place plain text next to label within a form .