Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Support placing the navbar into the top navigation
<?php
namespace Drupal\bootstrap_mobildata\Plugin\Form;
use Drupal\bootstrap\Annotation\BootstrapForm;
use Drupal\bootstrap\Utility\Element;
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter().
*
* @BootstrapForm("search_block_form")
*/
class SearchBlockForm extends \Drupal\bootstrap\Plugin\Form\SearchBlockForm {
/**
* {@inheritdoc}
*/
public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
parent::alterFormElement($form, $form_state, $form_id);
$form->addClass(['navbar-form', 'navbar-right']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.