Skip to content

Instantly share code, notes, and snippets.

@kinglozzer
Created January 10, 2018 15:20
Show Gist options
  • Save kinglozzer/68f51ab7a8ea341042602bd7769f7380 to your computer and use it in GitHub Desktop.
Save kinglozzer/68f51ab7a8ea341042602bd7769f7380 to your computer and use it in GitHub Desktop.
<% with $CommentsForm %>
<% if $IncludeFormTag %>
<form $AttributesHTML>
<% end_if %>
<% if $Message %>
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
<% else %>
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
<% end_if %>
<fieldset>
<% if $Legend %><legend>$Legend</legend><% end_if %>
{$Fields.FieldByName('FieldGroup1').FieldHolder}
{$Fields.FieldByName('FieldGroup2').FieldHolder}
<div class="clear"><!-- --></div>
</fieldset>
<% if $Actions %>
<div class="Actions">
<% loop $Actions %>
$Field
<% end_loop %>
</div>
<% end_if %>
<% if $IncludeFormTag %>
</form>
<% end_if %>
<% end_with %>
<?php
$fieldGroup1 = CompositeField::create(
TextField::create($this->Intro_Name),
TextField::create($this->Intro_Something)
)->setName('FieldGroup1');
$fieldGroup2 = CompositeField::create(
TextField::create($this->Intro_Email),
TextField::create($this->Intro_SomethingElse)
)->setName('FieldGroup1');
$fields = FieldList::create($fieldGroup1, $fieldGroup2);
$form = Form::create(...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment