Form::VisibleFields() and FieldList::VisibleFields() #210

Merged
merged 2 commits into from Mar 9, 2012

Conversation

Projects
None yet
2 participants
Owner

sminnee commented Mar 7, 2012

I added these when working on a form when Form.ss is too heavyweight. It let me structure a form like this:

    <% with Form %>
    <form $FormAttributes>
        <% loop VisibleFields %>$Field<% end_loop %>
        $HiddenFields
        $Actions
    </form>
    <% end_with %>
forms/FieldList.php
+ * Return all fields except for the hidden fields.
+ * Useful when making your own simplified form layouts.
+ */
+ function VisibleFields() {
@stojg

stojg Mar 9, 2012

Contributor

According to style guidelines, public keyword must be explicitly set

Owner

sminnee commented Mar 9, 2012

OK, @stojg I've added some publicity.

sminnee added some commits Mar 7, 2012

API CHANGE: Added Form::VisibleFields() and FieldList::VisibleFields(…
…), which list everything except hidden fields, to assist with the creation of custom form layouts.
Contributor

stojg commented Mar 9, 2012

all good, merging.

stojg pushed a commit that referenced this pull request Mar 9, 2012

Stig Lindqvist
Merge pull request #210 from sminnee/form-visiblefields
Form::VisibleFields() and FieldList::VisibleFields()

@stojg stojg merged commit 2ab12af into silverstripe:master Mar 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment