public function StockReportForm::buildForm in Ubercart 8.4
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides FormInterface::buildForm
File
- uc_stock/
src/ Form/ StockReportForm.php, line 24
Class
- StockReportForm
- Displays a stock report for products with stock tracking enabled.
Namespace
Drupal\uc_stock\FormCode
public function buildForm(array $form, FormStateInterface $form_state, NodeInterface $node = NULL) {
$form['threshold'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Only show SKUs that are below their threshold.'),
'#default_value' => FALSE,
'#attributes' => [
'onchange' => 'this.form.submit();',
],
];
$form['actions'] = [
'#type' => 'actions',
];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Update'),
'#attributes' => [
'style' => "display:none;",
],
];
return $form;
}