-
Notifications
You must be signed in to change notification settings - Fork 0
CallbackCustomForm
GiantQuartz edited this page Apr 21, 2020
·
1 revision
$form = new CallbackCustomForm(new TranslationContainer("TITLE"));
$form->addElement("example", new Input(new TranslationContainer("INPUT"))); // Adds a element with the id 'example'
// Use CallbackCustomForm->setSubmitListener() to set a callback with a closure that
// will be executed whenever the form is submitted
$form->setSubmitListener(function($_) use ($form) {
$desc = $form->getElement("example")->getResult(); // The text introduced on the input 'example'
});
// Opens the form to a player
$player->openForm($form);