function RegistrationViewsHandlerStateEdit::views_form in Entity Registration 8.2
Same name in this branch
- 8.2 modules/registration_views/registration_views.module \RegistrationViewsHandlerStateEdit::views_form()
- 8.2 modules/registration_views/src/RegistrationViewsHandlerStateEdit.php \Drupal\registration_views\RegistrationViewsHandlerStateEdit::views_form()
Add to and alter the form.
File
- modules/
registration_views/ src/ RegistrationViewsHandlerStateEdit.php, line 31
Class
- RegistrationViewsHandlerStateEdit
- A Views' field handler for editing the registration state.
Namespace
Drupal\registration_viewsCode
function views_form(&$form, &$form_state) {
// Create a container for our replacements
$form[$this->options['id']] = array(
'#type' => 'container',
'#tree' => TRUE,
);
// Iterate over the result and add our replacement fields to the form.
foreach ($this->view->result as $row_index => $row) {
// Add a text field to the form. This array convention
// corresponds to the placeholder HTML comment syntax.
$form[$this->options['id']][$row_index] = array(
'#type' => 'select',
'#default_value' => $row->{$this->aliases['state']},
'#options' => registration_get_states_options(),
'#required' => TRUE,
);
}
}