Cake\View\Helper\FormHelper::hidden PHP Method

hidden() public method

Creates a hidden input field.
public hidden ( string $fieldName, array $options = [] ) : string
$fieldName string Name of a field, in the form of "modelname.fieldname"
$options array Array of HTML attributes.
return string A generated hidden input
    public function hidden($fieldName, array $options = [])
    {
        $options += ['required' => false, 'secure' => true];
        $secure = $options['secure'];
        unset($options['secure']);
        $options = $this->_initInputField($fieldName, array_merge($options, ['secure' => static::SECURE_SKIP]));
        if ($secure === true) {
            $this->_secure(true, $this->_secureFieldName($options['name']), (string) $options['val']);
        }
        $options['type'] = 'hidden';
        return $this->widget('hidden', $options);
    }