function ResponseStatus::buildConfigurationForm
Same name in other branches
- 11.x core/modules/system/src/Plugin/Condition/ResponseStatus.php \Drupal\system\Plugin\Condition\ResponseStatus::buildConfigurationForm()
Overrides ConditionPluginBase::buildConfigurationForm
File
-
core/
modules/ system/ src/ Plugin/ Condition/ ResponseStatus.php, line 62
Class
- ResponseStatus
- Provides a 'Response status' condition.
Namespace
Drupal\system\Plugin\ConditionCode
public function buildConfigurationForm(array $form, FormStateInterface $form_state) : array {
$status_codes = [
Response::HTTP_OK => $this->t('Success (@status_code)', [
'@status_code' => Response::HTTP_OK,
]),
Response::HTTP_FORBIDDEN => $this->t('Access denied (@status_code)', [
'@status_code' => Response::HTTP_FORBIDDEN,
]),
Response::HTTP_NOT_FOUND => $this->t('Page not found (@status_code)', [
'@status_code' => Response::HTTP_NOT_FOUND,
]),
];
$form['status_codes'] = [
'#type' => 'checkboxes',
'#title' => $this->t('Response status'),
'#options' => $status_codes,
'#default_value' => $this->configuration['status_codes'],
'#description' => $this->t('Shows the block on pages with any matching response status. If nothing is checked, the block is shown on all pages. Other response statuses are not used.'),
];
return parent::buildConfigurationForm($form, $form_state);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.