Skip to content

Instantly share code, notes, and snippets.

@hailwood
Created July 29, 2015 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hailwood/d03b286e71b8cf847857 to your computer and use it in GitHub Desktop.
Save hailwood/d03b286e71b8cf847857 to your computer and use it in GitHub Desktop.
$fields = new FieldList(
$hasSurnameField = new DropdownField('HasSurname', null, ['yes' => 'Yes', 'no' => 'No']),
$firstNameField = new TextField('FirstName', 'First name'),
$surnameField = new TextField('Surname', 'Surname')
);
$surnameField->displayIf("HasSurname")->isEqualTo("yes")->end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment