You are here

public function ImageFocusSettingsForm::buildForm in Image Focus Crop 8

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

src/Form/ImageFocusSettingsForm.php, line 30

Class

ImageFocusSettingsForm
Configure Image focus settings for this site.

Namespace

Drupal\image_focus\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['image_focus_face_detection_maxsize'] = [
    '#type' => 'number',
    '#min' => 50,
    '#field_suffix' => 'KB',
    '#title' => $this
      ->t('Max image size to face detect'),
    '#default_value' => $this
      ->config('image_focus.settings')
      ->get('image_focus_face_detection_maxsize'),
    '#required' => TRUE,
  ];
  return parent::buildForm($form, $form_state);
}