You can add a link to an image like this: PHP: $text = "Sample Text";$imagePath = "https://i.imgur.com/I0vNqpO.png"; // Put your image URL here$form->addButton($text, SimpleForm::IMAGE_TYPE_URL, $imagePath);
Error: "Class 'Games\SimpleForm' not found" (EXCEPTION) in "plugins/GamesUi/src/Games/Main" at line 63 Line: $form->addButton($text, SimpleForm::IMAGE_TYPE_URL, $imagePath);
$form->setTitle("title"); $form->setContent("Content"); $text = "Sample Text"; $imagePath = " "; // Put your image URL here $form->addButton($text, SimpleForm::IMAGE_TYPE_URL, $imagePath); $form->sendToPlayer($sender);
Put PHP: use jojoe77777\FormAPI\SimpleForm; at the top of your code. In the future use code and php tags in order to make code more readable, you can do this by pressing the "+" button of the post field and then pressing "Code". You can also write it like this: [php]php code here[/php] or [code]config files here [/code]
PHP: $form = $this->getServer()->getPluginManger()->getPlugin("FormAPI")->createSimpleForm(function (Player $p, $data){if($data === null){retrun true;}switch($data){case 0:break;}});$form->setTitle("Test");//0 patting, 1 Url$url = "https://camo.githubusercontent.com/5d19832972927279cbecd9c74dd50078d1dc74ca/68747470733a2f2f692e696d6775722e636f6d2f6549327861424c2e706e67"; //paste your url$form->addButton("Text", 1, $url"); I think this easy