Merge pull request #4127 from assertchris/clean-up-hidden-field

Clean up HiddenField
This commit is contained in:
Damian Mooyman 2015-04-30 16:14:09 +12:00
commit 204d3b1fec

View File

@ -1,4 +1,5 @@
<?php
/**
* Hidden field.
*
@ -6,25 +7,42 @@
* @subpackage fields-dataless
*/
class HiddenField extends FormField {
/**
* @param array $properties
*
* @return string
*/
public function FieldHolder($properties = array()) {
return $this->Field($properties);
}
/**
* @return static
*/
public function performReadonlyTransformation() {
$clone = clone $this;
$clone->setReadonly(true);
return $clone;
}
/**
* @return bool
*/
public function IsHidden() {
return true;
}
/**
* {@inheritdoc}
*/
public function getAttributes() {
return array_merge(
parent::getAttributes(),
array('type' => 'hidden')
array(
'type' => 'hidden',
)
);
}
}