Create hidden fields with validation error message.

@param array|string $hiddenFields List of hidden fields
name, like this "Modelname.fieldname"
@return string|null An HTML hidden input elements with error message block.
165865
public function hiddenFields($hiddenFields = null) {
		if (empty($hiddenFields)) {
			return null;
		}

		if (!is_array($hiddenFields)) {
			$hiddenFields = [$hiddenFields];
		}

		$result = '';
		$options = ['type' => 'hidden'];
		foreach ($hiddenFields as $hiddenField) {
			$result .= $this->input($hiddenField, $options);
			if ($this->isFieldError($hiddenField)) {
				$result .= $this->Html->div(
					'form-group has-error',
					$this->error($hiddenField, null, ['class' => 'help-block'])
				);
			}
		}

		return $result;
	}
1305120
public function hiddenInput($name, $value = null, $htmlOptions = array())
    {
        return $this->input($name, 'hidden', $value, $htmlOptions);
    }
1058596
private function extractHiddens(&$controls, array $hiddens = null)
    {
        if (!empty($hiddens)) {
            $dom   = new \DOMDocument('1.0');
            $nodes = [];
            foreach ($hiddens as $hidden) {
                $dom->loadHTML($hidden);
                $nodes = $dom->getElementsByTagName('input');
            }
            foreach ($nodes as $node) {
                $controls[$node->getAttribute('name')] = $node->getAttribute('value');
            }
        }
    }
540405
public function error_message($field = null, $default = false)
	{
		if ($field === null)
		{
			$messages = array();
			foreach ($this->error() as $field => $e)
			{
				$messages[$field] = $e->get_message();
			}
			return $messages;
		}

		return array_key_exists($field, $this->errors) ? $this->errors[$field]->get_message() : $default;
	}
189148
protected function addRequiredForSecretField(ValidatorResolver $resolver, $field, $hidden)
    {
        $resolver->sometimes($field, 'required', function ($input) use ($hidden) {
            return $input->$hidden == 'yes';
        });
    }
1170190
public function hiddenProperties()
    {
        foreach ($this->hiddenProperties as $formProperty) {
            if ($formProperty->active() === false) {
                continue;
            }

            yield $formProperty->propertyIdent() => $formProperty;
        }
    }
601236
public function hiddenField($key, $value=null, array $attr=[]){
		$this->context->hiddenField($key, $value, $attr);
	}
1170686
public function validateFieldSettings($fieldSettings)
    {
        $validationErrors = [];

        if (!is_array($fieldSettings)) {
            $validationErrors[] = new ValidationError('Field settings must be in form of an array');

            return $validationErrors;
        }

        foreach ($fieldSettings as $name => $value) {
            if (!isset($this->settingsSchema[$name])) {
                $validationErrors[] = new ValidationError(
                    'Setting "%setting%" is unknown',
                    null,
                    [
                        '%setting%' => $name,
                    ],
                    "[${name}]"
                );

                continue;
            }

            switch ($name) {
                case 'hideRootTag':
                    if (!is_bool($value)) {
                        $validationErrors[] = new ValidationError(
                            "Setting '%setting%' value must be of boolean type",
                            null,
                            [
                                '%setting%' => $name,
                            ],
                            "[${name}]"
                        );
                    }

                    break;
                case 'editView':
                    if (!is_string($value)) {
                        $validationErrors[] = new ValidationError(
                            "Setting '%setting%' value must be of string type",
                            null,
                            [
                                '%setting%' => $name,
                            ],
                            "[${name}]"
                        );
                    }

                    $editViewExists = false;
                    foreach ($this->availableEditViews as $editView) {
                        if ($editView['identifier'] === $value) {
                            $editViewExists = true;

                            break;
                        }
                    }

                    if (!$editViewExists) {
                        $validationErrors[] = new ValidationError(
                            "Edit view '%editView%' does not exist",
                            null,
                            [
                                '%editView%' => $value,
                            ],
                            "[${name}]"
                        );
                    }

                    break;
            }
        }

        return $validationErrors;
    }
706209
public function hidden($name, $value = null, array $attributes = [])
    {
        $value = $this->getDefaultValue($name, $value);
        return $this->input('hidden', $name, $value, $attributes);
    }
967586
public function hidden($field, $value = null, array $attributes = array())
	{
		if (is_array($field))
		{
			$attributes = $field;
		}
		else
		{
			$attributes['name'] = (string) $field;
			$attributes['value'] = (string) $value;
		}
		$attributes['type'] = 'hidden';

		return $this->input($attributes);
	}
15085
public function validate($fields = null)
    {
        $this->_di->modelsValidator->validate($this, $fields ?: $this->getChangedFields());
    }
929812
public static function input_hidden_params(moodle_url $url, array $exclude = null) {
        $exclude = (array)$exclude;
        $params = $url->params();
        foreach ($exclude as $key) {
            unset($params[$key]);
        }

        $output = '';
        foreach ($params as $key => $value) {
            $attributes = array('type'=>'hidden', 'name'=>$key, 'value'=>$value);
            $output .= self::empty_tag('input', $attributes)."\n";
        }
        return $output;
    }
639180
public function updateFieldSet(&$fieldset)
    {
        if (!$fieldset->fieldByName($this->getName())) {
            $field = new HiddenField($this->getName(), null, $this->getValue());
            $fieldset->push($field);
            return $field;
        } else {
            return false;
        }
    }
991980
public function errored($field = null)
    {
        if (!func_num_args()) {
            return !!$this->_errors;
        }
        return isset($this->_errors[$field]);
    }
1120967
protected function renderHiddenReferrerFields()
    {
        $result = chr(10);
        $request = $this->controllerContext->getRequest();
        $argumentNamespace = null;
        if (!$request->isMainRequest()) {
            $argumentNamespace = $request->getArgumentNamespace();

            $referrer = array(
                '@package' => $request->getControllerPackageKey(),
                '@subpackage' => $request->getControllerSubpackageKey(),
                '@controller' => $request->getControllerName(),
                '@action' => $request->getControllerActionName(),
                'arguments' => $this->hashService->appendHmac(base64_encode(serialize($request->getArguments())))
            );
            foreach ($referrer as $referrerKey => $referrerValue) {
                $referrerValue = htmlspecialchars($referrerValue);
                $result .= '<input type="hidden" name="' . $argumentNamespace . '[__referrer][' . $referrerKey . ']" value="' . $referrerValue . '" />' . chr(10);
            }
            $request = $request->getParentRequest();
        }

        $arguments = $request->getArguments();
        if ($argumentNamespace !== null && isset($arguments[$argumentNamespace])) {
            // A sub request was there; thus we can unset the sub requests arguments,
            // as they are transferred separately via the code block shown above.
            unset($arguments[$argumentNamespace]);
        }

        $referrer = array(
            '@package' => $request->getControllerPackageKey(),
            '@subpackage' => $request->getControllerSubpackageKey(),
            '@controller' => $request->getControllerName(),
            '@action' => $request->getControllerActionName(),
            'arguments' => $this->hashService->appendHmac(base64_encode(serialize($arguments)))
        );

        foreach ($referrer as $referrerKey => $referrerValue) {
            $result .= '<input type="hidden" name="__referrer[' . $referrerKey . ']" value="' . htmlspecialchars($referrerValue) . '" />' . chr(10);
        }
        return $result;
    }
600333
private function findHiddenField($field)
    {
        $node = $this->getSession()->getPage()->find(
            'xpath',
            strtr(
                ".//input[./@type = 'hidden'][(./@id = '%locator%' or ./@name = '%locator%')]",
                array('%locator%' => $field)
            )
        );
        if (null === $node) {
            throw new ElementNotFoundException($this->getSession(), 'hidden field', 'id|name', $field);
        }

        return $node;
    }
988432
public function transformReadonly(FieldList $fields)
    {
        foreach ($fields->dataFields() as $field) {
            if ($field instanceof HiddenField) {
                continue;
            }
            $newField = $field->castedCopy(HTMLReadonlyField::class);
            $fields->replaceField($field->getName(), $newField);
        }
        return $fields;
    }