silverstripe-framework/forms/HiddenField.php

54 lines
773 B
PHP
Raw Permalink Normal View History

<?php
2015-04-27 23:08:51 +02:00
/**
* Hidden field.
*
* @package forms
* @subpackage fields-dataless
*/
class HiddenField extends FormField {
2015-04-27 23:08:51 +02:00
/**
* @param array $properties
*
2015-06-20 12:11:08 +02:00
* @return HTMLText
2015-04-27 23:08:51 +02:00
*/
public function FieldHolder($properties = array()) {
return $this->Field($properties);
}
2015-04-27 23:08:51 +02:00
/**
* @return static
*/
public function performReadonlyTransformation() {
$clone = clone $this;
2015-04-27 23:08:51 +02:00
$clone->setReadonly(true);
2015-04-27 23:08:51 +02:00
return $clone;
}
2015-04-27 23:08:51 +02:00
/**
* @return bool
*/
public function IsHidden() {
return true;
}
2015-04-27 23:08:51 +02:00
/**
* {@inheritdoc}
*/
public function getAttributes() {
return array_merge(
parent::getAttributes(),
2015-04-27 23:08:51 +02:00
array(
'type' => 'hidden',
)
);
}
function SmallFieldHolder($properties = array()) {
return $this->FieldHolder($properties);
}
}