silverstripe-framework/Forms/HiddenField.php

55 lines
813 B
PHP
Raw Normal View History

<?php
2015-04-27 23:08:51 +02:00
namespace SilverStripe\Forms;
/**
* Hidden field.
*/
class HiddenField extends FormField {
protected $schemaDataType = FormField::SCHEMA_DATA_TYPE_HIDDEN;
2015-04-27 23:08:51 +02:00
/**
* @param array $properties
* @return string
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);
}
}