We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This seems like a very useful formfield, could you please provide some more informations on how to set it up correctly?
The text was updated successfully, but these errors were encountered:
Yes, we need to do docs
Some examples of how we used it for now:
AutocompleteField::create( 'MemberID', 'Email address', array($this, 'getMembers'), array( 'searchKey' => 'NiceTitle', 'displayKey' => 'NiceTitle', 'rawFieldKey' => 'Email', 'rawValueFieldClass' => 'EmailField', ) )->setRecordFormatter('MemberExtension::frontend_autocomplete');
static public function frontend_autocomplete($data) { $data = $data->toArray(); foreach($data as &$member) { $niceTitle = $member->getName() ?: 'Invited member'; $niceTitle = call_user_func_array( 'sprintf', array( '%s • %s', $niceTitle, $member->Email, ) ); $member = array( 'ID' => $member->ID, 'Email' => $member->Email ?: $member->getName(), 'SafeName' => $member->getSafeName(), 'NiceTitle' => $niceTitle, ); } return $data; }
Sorry, something went wrong.
No branches or pull requests
This seems like a very useful formfield, could you please provide some more informations on how to set it up correctly?
The text was updated successfully, but these errors were encountered: