mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
3ccada55ab
commit
ef5ffe52a1
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user