public SearchPageFormBase::form(array $form, FormStateInterface $form_state)
Gets the actual form array to be built.
Overrides EntityForm::form
See also
\Drupal\Core\Entity\EntityForm::processForm()
\Drupal\Core\Entity\EntityForm::afterBuild()
File
- core/modules/search/src/Form/SearchPageFormBase.php, line 86
Class
- SearchPageFormBase
- Provides a base form for search pages.
Namespace
Drupal\search\Form
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | public function form( array $form , FormStateInterface $form_state ) { $form [ 'label' ] = array ( '#type' => 'textfield' , '#title' => $this ->t( 'Label' ), '#description' => $this ->t( 'The label for this search page.' ), '#default_value' => $this ->entity->label(), '#maxlength' => '255' , ); $form [ 'id' ] = array ( '#type' => 'machine_name' , '#default_value' => $this ->entity->id(), '#disabled' => ! $this ->entity->isNew(), '#maxlength' => 64, '#machine_name' => array ( 'exists' => array ( $this , 'exists' ), ), ); $form [ 'path' ] = array ( '#type' => 'textfield' , '#title' => $this ->t( 'Path' ), '#field_prefix' => 'search/' , '#default_value' => $this ->entity->getPath(), '#maxlength' => '255' , '#required' => TRUE, ); $form [ 'plugin' ] = array ( '#type' => 'value' , '#value' => $this ->entity->get( 'plugin' ), ); if ( $this ->plugin instanceof PluginFormInterface) { $form += $this ->plugin->buildConfigurationForm( $form , $form_state ); } return parent::form( $form , $form_state ); } |
Please login to continue.