edlptheme.theme 675 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * @file
  4. * Functions to support theming in the edlp theme.
  5. */
  6. use Drupal\Core\Form\FormStateInterface;
  7. // function edlptheme_preprocess_input(&$vars){
  8. // dsm($vars, 'vars');
  9. // $vars['attributes']['placeholder'] = "salut";
  10. // }
  11. /**
  12. * Implements hook_form_alter
  13. */
  14. function edlptheme_form_user_login_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  15. // dpm($form_id, 'form_id');
  16. // dpm($form, 'form');
  17. $form['name']['#attributes']['placeholder'] = (string) $form['name']['#title'];
  18. unset($form['name']['#title']);
  19. $form['pass']['#attributes']['placeholder'] = (string) $form['pass']['#title'];
  20. unset($form['pass']['#title']);
  21. }