API: add TextField_Disabled

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64323 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2008-10-16 00:36:50 +00:00
parent a574ac1fc8
commit 19d5b377a8

View File

@ -37,4 +37,22 @@ class TextField extends FormField {
} }
class TextField_Disabled extends TextField{
function Field() {
$attributes = $attributes = array(
'type' => 'text',
'class' => $this->extraClass() . ' text',
'id' => $this->id(),
'name' => $this->Name(),
'value' => $this->Value(),
'tabindex' => $this->getTabIndex(),
'maxlength' => ($this->maxLength) ? $this->maxLength : null,
'size' => ($this->maxLength) ? min( $this->maxLength, 30 ) : null,
'disabled' => 'disabled'
);
return $this->createTag('input', $attributes);
}
}
?> ?>