✔️ Provides form classes for await-generator
kim\present\libasynform\CustomForm
kim\present\libasynform\ModalForm
kim\present\libasynform\SimpleForm
- Use static method
::create()
to create form object - Fill in the contents using the methods of each form class
- Use member method
->send(Player)
to send the form to the playerDon't use
Player::sendForm()
method yourself
example)
use kim\present\libasynform\CustomForm;
use SOFe\AwaitGenerator\Await;
Await::f2c(function() use($player) : \Generator{
$recieve = yield from CustomForm::create("OpenMenu")
->addToggle("I want open menu", true, "open")
->addToggle("I want close menu", false, "close")
->addDropdown("I want ", ["close menu", "open menu"], 1, "select")
->addInput("I want ", "what do you want", "open menu", "want")
->send($player);
// if player close form, $recieve is null
// else, below
var_dump($recieve);
/*
array(4) {
["open"]=>
bool(true)
["close"]=>
bool(false)
["select"]=>
int(1)
["want"]=>
string(9) "open menu"
}
*/
});
See Official Poggit Virion Documentation
See Main Document
Distributed under the MIT. See LICENSE for more information