public function AlternativeFrontpageSettings::buildForm in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 8.2 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 8.3 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 8.4 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 8.5 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 8.6 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 8.7 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 8.8 modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 10.3.x modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 10.0.x modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 10.1.x modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
- 10.2.x modules/custom/alternative_frontpage/src/Form/AlternativeFrontpageSettings.php \Drupal\alternative_frontpage\Form\AlternativeFrontpageSettings::buildForm()
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 ConfigFormBase::buildForm
File
- modules/
custom/ alternative_frontpage/ src/ Form/ AlternativeFrontpageSettings.php, line 66
Class
- AlternativeFrontpageSettings
- Class AlternativeFrontpageSettings.
Namespace
Drupal\alternative_frontpage\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('alternative_frontpage.settings');
$site_config = $this
->config('system.site');
$form['frontpage_for_anonymous_users'] = [
'#type' => 'textfield',
'#title' => $this
->t('Frontpage for anonymous users'),
'#description' => $this
->t('Enter the frontpage for anonymous users. This setting will override the homepage which is set in the Site Configuration form. Enter the path starting with a forward slash. Default: /stream.'),
'#maxlength' => 64,
'#size' => 64,
'#default_value' => $site_config
->get('page.front'),
];
$form['frontpage_for_authenticated_user'] = [
'#type' => 'textfield',
'#title' => $this
->t('Frontpage for authenticated users'),
'#description' => $this
->t('Enter the frontpage for authenticated users. When the value is left empty it will use the anonymous homepage for authenticated users as well. Enter the path starting with a forward slash. Default: /stream.'),
'#maxlength' => 64,
'#size' => 64,
'#default_value' => $config
->get('frontpage_for_authenticated_user'),
];
return parent::buildForm($form, $form_state);
}