silverstripe-framework/forms/HiddenField.php
Andrew O'Neil de2832e65f ENHANCEMENT: Allow Object::create() to be called with late static binding.
This allows DataList::create('SiteTree') as equivalent to Object::create('DataList', 'SiteTree'), without
having to have a create() function on DataList. Required for E_STRICT compliance.
2012-03-27 17:57:42 +13:00

31 lines
489 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')
);
}
}