finished to theme search form

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-19 18:21:41 +01:00
parent 8f7ab6bb66
commit 4d2a3f85ce
4 changed files with 294 additions and 21 deletions
@@ -24,32 +24,41 @@ class EdlpSearchForm extends FormBase {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form['keys'] = [
'#type' => 'search',
// '#title' => $this->t('Keys'),
'#maxlength' => 64,
'#size' => 15,
'#weight' => '0',
$form['fieldset_search'] = [
'#type' => 'fieldgroup',
'#title' => $this->t('Search'),
'keys' => [
'#type' => 'search',
'#maxlength' => 20,
'#size' => 15,
'#weight' => '0',
]
];
$form['language'] = [
'#type' => 'textfield',
$form['fieldset_langues'] = [
'#type' => 'fieldgroup',
'#title' => $this->t('Language'),
'#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete',
'#autocomplete_route_parameters' => array('field_name' => 'field_langues'),
'#maxlength' => 64,
'#size' => 15,
'#weight' => '0',
'language' => [
'#type' => 'textfield',
'#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete',
'#autocomplete_route_parameters' => array('field_name' => 'field_langues'),
'#maxlength' => 20,
'#size' => 15,
'#weight' => '0',
]
];
$form['genres'] = [
'#type' => 'textfield',
$form['fieldset_genre'] = [
'#type'=>'fieldgroup',
'#title' => $this->t('Genres'),
'#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete',
'#autocomplete_route_parameters' => array('field_name' => 'field_genres'),
'#maxlength' => 64,
'#size' => 15,
'#weight' => '0',
'genres' => [
'#type' => 'textfield',
'#autocomplete_route_name' => 'edlp_search.edlp_search_controller_autocomplete',
'#autocomplete_route_parameters' => array('field_name' => 'field_genres'),
'#maxlength' => 20,
'#size' => 15,
'#weight' => '0',
]
];
$this->getEntries();