1 <?php
2 3 4 5 6
7 class HiddenField extends FormField {
8 9 10
11 function Field() {
12 $attributes = array(
13 'type' => 'hidden',
14 'class' => 'hidden' . $this->extraClass(),
15 'id' => $this->id(),
16 'name' => $this->Name(),
17 'value' => $this->attrValue(),
18 );
19
20 return $this->createTag('input', $attributes);
21 }
22
23 function FieldHolder() {
24 return $this->Field();
25 }
26
27 function performReadonlyTransformation() {
28 $clone = clone $this;
29 $clone->setReadonly(true);
30 return $clone;
31 }
32
33 function IsHidden() {
34 return true;
35 }
36
37 static function create($name) { return new HiddenField($name); }
38 }
39
40 ?>
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-