Created
November 5, 2009 01:50
-
-
Save sminnee/226616 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: sapphire/forms/FieldSet.php | |
| =================================================================== | |
| --- sapphire/forms/FieldSet.php (revision 90572) | |
| +++ sapphire/forms/FieldSet.php (working copy) | |
| @@ -418,7 +418,7 @@ | |
| * @return FieldSet | |
| */ | |
| function HiddenFields() { | |
| - $hiddenFields = new FieldSet(); | |
| + $hiddenFields = new HiddenFieldSet(); | |
| $dataFields = $this->dataFields(); | |
| if($dataFields) foreach($dataFields as $field) { | |
| @@ -534,4 +534,18 @@ | |
| } | |
| +/** | |
| + * 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; | |
| + } | |
| +} | |
| + | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment