mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-26 12:36:07 +02:00
36 lines
560 B
PHP
36 lines
560 B
PHP
<?php
|
|
/**
|
|
* Hidden field.
|
|
* @package forms
|
|
* @subpackage fields-dataless
|
|
*/
|
|
class HiddenField extends FormField {
|
|
|
|
protected $template = 'HiddenField';
|
|
|
|
function FieldHolder() {
|
|
return $this->Field();
|
|
}
|
|
|
|
function performReadonlyTransformation() {
|
|
$clone = clone $this;
|
|
$clone->setReadonly(true);
|
|
return $clone;
|
|
}
|
|
|
|
function IsHidden() {
|
|
return true;
|
|
}
|
|
|
|
function getAttributes() {
|
|
return array_merge(
|
|
parent::getAttributes(),
|
|
array('type' => 'hidden')
|
|
);
|
|
}
|
|
|
|
static function create($name) {
|
|
return new HiddenField($name);
|
|
}
|
|
|
|
} |