API CHANGE: Inserting $HiddenFields into a form template will show the input tags of all the hidden fields. (from r90871)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@90962 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-11-06 22:53:52 +00:00
parent 3ccada55ab
commit ef5ffe52a1

View File

@ -418,7 +418,7 @@ class FieldSet extends DataObjectSet {
* @return FieldSet
*/
function HiddenFields() {
$hiddenFields = new FieldSet();
$hiddenFields = new HiddenFieldSet();
$dataFields = $this->dataFields();
if($dataFields) foreach($dataFields as $field) {
@ -534,4 +534,18 @@ class FieldSet extends DataObjectSet {
}
/**
* A fieldset designed to store a list of hidden fields. When inserted into a template, only the
* input tags will be included
*/
class HiddenFieldSet extends FieldSet {
function forTemplate() {
$output = "";
foreach($this as $field) {
$output .= $field->Field();
}
return $output;
}
}
?>