function AjaxColorForm::getColors
Same name in other branches
- 3.x modules/form_api_example/src/Form/AjaxColorForm.php \Drupal\form_api_example\Form\AjaxColorForm::getColors()
- 4.0.x modules/form_api_example/src/Form/AjaxColorForm.php \Drupal\form_api_example\Form\AjaxColorForm::getColors()
Returns an array of colors grouped by color temperature.
Return value
array An associative array of color data, keyed by color temperature.
1 call to AjaxColorForm::getColors()
- AjaxColorForm::getColorTemperatures in form_api_example/
src/ Form/ AjaxColorForm.php - Returns a list of color temperatures.
File
-
form_api_example/
src/ Form/ AjaxColorForm.php, line 126
Class
- AjaxColorForm
- Implements the ajax demo form controller.
Namespace
Drupal\form_api_example\FormCode
protected function getColors() {
return [
'warm' => [
'name' => $this->t('Warm'),
'colors' => [
'red' => $this->t('Red'),
'orange' => $this->t('Orange'),
'yellow' => $this->t('Yellow'),
],
],
'cool' => [
'name' => $this->t('Cool'),
'colors' => [
'blue' => $this->t('Blue'),
'purple' => $this->t('Purple'),
'green' => $this->t('Green'),
],
],
];
}