Form Builder
Form-Builder provides a flexible form interface allowing editing a variety of CiviCRM entities as well as a developer interface.
The GUI can be extended via the civi.afform_admin.metadata
event.
This event is used for adding entities, elements, input types, etc.
It is also possible to expose entities by adding a declaration. To do this:
- Add the mixin
<mixin>afform-entity-php@1.0.0</mixin>
to your extension'sinfo.xml
file (note: for backward compatability with versions < 5.50 you must add a shim. - Ensure the entity in question has apiv4 crud entities
- Create a php file in the following location -
afformEntities/EntityName.php
as you can see here in thededuper
extension - Add the following detail - where
url-autofill
is the default value for autofill when adding this entity to a form.
<?php
return [
'entity' => 'ContactNamePair',
'label' => 'Equivalent name pair',
'defaults' => "{'url-autofill': '1'}",
];