mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Updated fieldgroup class and example code
This commit is contained in:
parent
541436feb0
commit
b68cd6610c
@ -9,14 +9,14 @@
|
|||||||
* <b>Usage</b>
|
* <b>Usage</b>
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* new FieldGroup(
|
* FieldGroup::create(
|
||||||
* new FieldGroup(
|
* FieldGroup::create(
|
||||||
* new HeaderField('FieldGroup 1'),
|
* HeaderField::create('FieldGroup 1'),
|
||||||
* new TextField('Firstname')
|
* TextField::create('Firstname')
|
||||||
* ),
|
* ),
|
||||||
* new FieldGroup(
|
* FieldGroup::create(
|
||||||
* new HeaderField('FieldGroup 2'),
|
* HeaderField::create('FieldGroup 2'),
|
||||||
* new TextField('Surname')
|
* TextField::create('Surname')
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
* </code>
|
* </code>
|
||||||
@ -28,10 +28,10 @@
|
|||||||
* $fields = parent::getCMSFields();
|
* $fields = parent::getCMSFields();
|
||||||
*
|
*
|
||||||
* $fields->addFieldToTab(
|
* $fields->addFieldToTab(
|
||||||
* 'Root.Content',
|
* 'Root.Main',
|
||||||
* new FieldGroup(
|
* FieldGroup::create(
|
||||||
* new TimeField("StartTime","What's the start time?"),
|
* TimeField::create("StartTime","What's the start time?"),
|
||||||
* new TimeField("EndTime","What's the end time?")
|
* TimeField::create("EndTime","What's the end time?")
|
||||||
* ),
|
* ),
|
||||||
* 'Content'
|
* 'Content'
|
||||||
* );
|
* );
|
||||||
@ -41,6 +41,17 @@
|
|||||||
* }
|
* }
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
|
* <b>Setting a title to a FieldGroup</b>
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* $fields->addFieldToTab("Root.Main",
|
||||||
|
* FieldGroup::create(
|
||||||
|
* TimeField::create('StartTime','What's the start time?'),
|
||||||
|
* TimeField::create('EndTime', 'What's the end time?')
|
||||||
|
* )->setTitle('Time')
|
||||||
|
* );
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
* @package forms
|
* @package forms
|
||||||
* @subpackage fields-structural
|
* @subpackage fields-structural
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div <% if $Name %>id="$Name"<% end_if %> class="field $Type $extraClass">
|
<div <% if $Name %>id="$Name"<% end_if %> class="field $Type">
|
||||||
<% if $Title %><label class="left">$Title</label><% end_if %>
|
<% if $Title %><label class="left">$Title</label><% end_if %>
|
||||||
|
|
||||||
<div class="middleColumn fieldgroup <% if Zebra %>fieldgroup-$Zebra<% end_if %>">
|
<div class="middleColumn fieldgroup<% if $Zebra %> fieldgroup-$Zebra<% end_if %>">
|
||||||
<% loop $FieldList %>
|
<% loop $FieldList %>
|
||||||
<div class="fieldgroup-field $FirstLast $EvenOdd">
|
<div class="fieldgroup-field $FirstLast $EvenOdd">
|
||||||
$SmallFieldHolder
|
$SmallFieldHolder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user