1. Go to this page and download the library: Download diatechnis/vellum library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
protected function createInputs(): InputsInterface
{
return new Inputs(
new TextInput(
$name = 'button_text',
$description = 'Button Text',
$default_value = 'Submit'
)
);
}
protected function createInputs(): InputsInterface
{
return new Inputs(
new SelectOneInput(
$name = 'open_in_new_window',
$description = 'Open the link in a new window?',
$supply_value_as = Formats::NUMBER,
$options = new Options(
new Option('Same window', 0),
new Option('New window', 1)
),
$default_value = 0
)
);
}
protected function createDisplayTypes(): DisplayTypesInterface
{
return new DisplayTypes(
new DisplayType(
$name = 'submit',
$inputs = new Inputs(
new SelectOneInput(
'submit_via_ajax',
'Submit form via an ajax request?',
Formats::NUMBER,
new Options(
new Option('No', 0),
new Option('Yes', 1)
),
0
)
),
$description = 'Submit Button',
$default_display_type = true
),
new DisplayType(
$name = 'cancel',
$inputs = new Inputs(
new TextInput(
'confirm_message',
'Message to ask if user is sure',
'Are you sure you want to cancel this?'
)
),
$description = 'Cancel Button'
)
);
}