PHP code example of ride / wba-task
1. Go to this page and download the library: Download ride/wba-task 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/ */
ride / wba-task example snippets
namespace my;
use ride\library\i18n\translator\Translator;
use ride\library\form\FormBuilder;
use ride\library\system\file\browser\FileBrowser;
use ride\web\base\task\AbstractTask;
class TestTask extends AbstractTask {
/**
* Name of this task, should be the same as your dependency id
* @var string
*/
const NAME = 'test';
/**
* Constructs a new test task
* @param \ride\library\system\file\browser\FileBrowser $fileBrowser Let's
* use the file browser to retrieve the job result
*/
public function __construct(FileBrowser $fileBrowser) {
$this->fileBrowser = $fileBrowser;
}
/**
* Hook to prepare the form to ask for extra arguments
* @param \ride\library\form\FormBuilder $form
* @param \ride\library\i18n\translator\Translator $translator
* @return null
*/
public function prepareForm(FormBuilder $form, Translator $translator) {
// if you need extra information for your task, you can use this hook
// to prepare a form which asks for these arguments
$form->addRow('test', 'string', array(
'validators' => array('