facets_range_input-8.x-1.x-dev/facets_range_input.module
facets_range_input.module
<?php
/**
* @file
* Contains facets_range_input.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Hook\Attribute\LegacyHook;
use Drupal\facets_range_input\Hook\ThemeHooks;
/**
* Implements hook_help().
*/
function facets_range_input_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the facets_range_input module.
case 'help.page.facets_range_input':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Facets Range Input') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
#[LegacyHook]
function facets_range_input_theme() {
return \Drupal::service(ThemeHooks::class)->theme();
}
function buildWidgitForm() {
$form['minimum'] = [
'#type' => 'textfield',
'#title' => t('Minimum'),
'#placeholder' => t('Amazing!'),
//'#description' => $this->t('Minimum Range'),
'#maxlength' => 10,
'#size' => 10,
'#weight' => '0',
];
$form['maximum'] = [
'#type' => 'textfield',
'#title' => t('Maximum'),
'#placeholder' => t('Amazing!'),
//'#description' => $this->t('Maximum Range'),
'#maxlength' => 10,
'#size' => 10,
'#weight' => '0',
];
$form['submit'] = [
'#type' => 'submit',
'#value' => t('Apply'),
];
return $form;
}