mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE: Inserting $HiddenFields into a form template will show the input tags of all the hidden fields.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90871 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e3fa5cae7f
commit
6e23d7ebbb
@ -418,7 +418,7 @@ class FieldSet extends DataObjectSet {
|
|||||||
* @return FieldSet
|
* @return FieldSet
|
||||||
*/
|
*/
|
||||||
function HiddenFields() {
|
function HiddenFields() {
|
||||||
$hiddenFields = new FieldSet();
|
$hiddenFields = new HiddenFieldSet();
|
||||||
$dataFields = $this->dataFields();
|
$dataFields = $this->dataFields();
|
||||||
|
|
||||||
if($dataFields) foreach($dataFields as $field) {
|
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…
x
Reference in New Issue
Block a user