Add fields to the beginning / end of an Edit Form when you cannot predict the field name

When you need to add a field to the start or end of a set of fields on an edit form but you don't know the name of the field to insert it after or before... you can use an empty string...

$fields->insertBefore(TextField::create('MyField', 'MyField'), '');

$fields->insertAfter(TextField::create('MyField', 'MyField'), '');
Rate this post (2 ratings)

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments