mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #4127 from assertchris/clean-up-hidden-field
Clean up HiddenField
This commit is contained in:
commit
204d3b1fec
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hidden field.
|
* Hidden field.
|
||||||
*
|
*
|
||||||
@ -6,25 +7,42 @@
|
|||||||
* @subpackage fields-dataless
|
* @subpackage fields-dataless
|
||||||
*/
|
*/
|
||||||
class HiddenField extends FormField {
|
class HiddenField extends FormField {
|
||||||
|
/**
|
||||||
|
* @param array $properties
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function FieldHolder($properties = array()) {
|
public function FieldHolder($properties = array()) {
|
||||||
return $this->Field($properties);
|
return $this->Field($properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return static
|
||||||
|
*/
|
||||||
public function performReadonlyTransformation() {
|
public function performReadonlyTransformation() {
|
||||||
$clone = clone $this;
|
$clone = clone $this;
|
||||||
|
|
||||||
$clone->setReadonly(true);
|
$clone->setReadonly(true);
|
||||||
|
|
||||||
return $clone;
|
return $clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function IsHidden() {
|
public function IsHidden() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function getAttributes() {
|
public function getAttributes() {
|
||||||
return array_merge(
|
return array_merge(
|
||||||
parent::getAttributes(),
|
parent::getAttributes(),
|
||||||
array('type' => 'hidden')
|
array(
|
||||||
|
'type' => 'hidden',
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user