Skip to content
VennV edited this page Jul 30, 2024 · 4 revisions
HELLO USER
Welcome to VFormOOPAPI's Wiki!!,
We will show you how to use it

What is this?

  • This is a menu virion created and developed by VennDev
  • It is similar to FormAPI in that there are 3 types of menus, which are:

Code in onEnable()

...
use venndev\vformoopapi\VFormLoader;

public function onEnable() : void{
   VFormLoader::init($this);
}
  • Note: You need to init VFormLoader::init($this) to request the method definition into your plugin to use this virion!

Example

YourForm.php

use venndev\vformoopapi\Form;
use venndev\vformoopapi\utils\TypeForm;
....

#[VForm(
  title: "Your Title",
  type: TypeForm::NORMAL_FORM
)]
class YourForm extends Form{
  use SingletonTrait;
  public function __construct(Player $player){
   parent::__construct($player);
  }
  //Your code in here...
}

YourCommandFile.php

use YourFile;

class YourCommandFile {
  //Your code...
  public function execute(CommandSender $sender, string $label, array $args){
   if ($sender instanceof Player) {
      YourFile::getInstance($player)->sendForm();
   }
  }
}
Clone this wiki locally