public function CmisCreateFolderForm::buildForm in CMIS API 8
Same name and namespace in other branches
- 8.2 src/Form/CmisCreateFolderForm.php \Drupal\cmis\Form\CmisCreateFolderForm::buildForm()
- 3.0.x src/Form/CmisCreateFolderForm.php \Drupal\cmis\Form\CmisCreateFolderForm::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 FormInterface::buildForm
File
- src/
Form/ CmisCreateFolderForm.php, line 25
Class
- CmisCreateFolderForm
- Class CmisCreateFolder.
Namespace
Drupal\cmis\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$params = \Drupal::routeMatch();
$form['folder_name'] = [
'#type' => 'textfield',
'#title' => $this
->t('Folder name'),
'#description' => $this
->t('Enter the new folder name'),
'#maxlength' => 255,
'#size' => 64,
'#required' => TRUE,
];
$form['folder_description'] = [
'#type' => 'textarea',
'#title' => $this
->t('Folder description'),
'#description' => $this
->t('Enter the folder description'),
];
$form['config'] = [
'#type' => 'hidden',
'#default_value' => $params
->getParameter('config'),
];
$form['folder_id'] = [
'#type' => 'hidden',
'#default_value' => $params
->getParameter('folder_id'),
];
$form['operation']['submit'] = [
'#type' => 'submit',
'#value' => t('Create folder'),
];
return $form;
}