PHP code example of upline / fill-button
1. Go to this page and download the library: Download upline/fill-button 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/ */
upline / fill-button example snippets
use Upline\FillButton;
FillButton::make('Fill total fields', 'fill-prices')
->setFillFunction(function ($data) {
return [
'total' => $data['price'] + $data['quantity'],
'totalDiscount' => $data['discount'] + $data['quantity'],
];
})
->setSourceFields(['price', 'discount', 'quantity'])