2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
2015-04-27 23:08:51 +02:00
|
|
|
|
2016-08-19 00:51:35 +02:00
|
|
|
namespace SilverStripe\Forms;
|
|
|
|
|
2007-07-19 12:40:28 +02:00
|
|
|
/**
|
|
|
|
* Hidden field.
|
|
|
|
*/
|
2016-11-29 00:31:16 +01:00
|
|
|
class HiddenField extends FormField
|
|
|
|
{
|
|
|
|
|
|
|
|
protected $schemaDataType = FormField::SCHEMA_DATA_TYPE_HIDDEN;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array $properties
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function FieldHolder($properties = array())
|
|
|
|
{
|
|
|
|
return $this->Field($properties);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return static
|
|
|
|
*/
|
|
|
|
public function performReadonlyTransformation()
|
|
|
|
{
|
|
|
|
$clone = clone $this;
|
|
|
|
|
|
|
|
$clone->setReadonly(true);
|
|
|
|
|
|
|
|
return $clone;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function IsHidden()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getAttributes()
|
|
|
|
{
|
|
|
|
return array_merge(
|
|
|
|
parent::getAttributes(),
|
|
|
|
array(
|
|
|
|
'type' => 'hidden',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function SmallFieldHolder($properties = array())
|
|
|
|
{
|
|
|
|
return $this->FieldHolder($properties);
|
|
|
|
}
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|