3 namespace Drupal\views\Plugin\views\argument_default;
5 use Drupal\Core\Cache\Cache;
6 use Drupal\Core\Cache\CacheableDependencyInterface;
7 use Drupal\Core\Form\FormStateInterface;
10 * The fixed argument default handler.
12 * @ingroup views_argument_default_plugins
14 * @ViewsArgumentDefault(
16 * title = @Translation("Fixed")
19 class Fixed extends ArgumentDefaultPluginBase implements CacheableDependencyInterface {
24 protected function defineOptions() {
25 $options = parent::defineOptions();
26 $options['argument'] = ['default' => ''];
34 public function buildOptionsForm(&$form, FormStateInterface $form_state) {
35 parent::buildOptionsForm($form, $form_state);
37 '#type' => 'textfield',
38 '#title' => $this->t('Fixed value'),
39 '#default_value' => $this->options['argument'],
46 public function getArgument() {
47 return $this->options['argument'];
53 public function getCacheMaxAge() {
54 return Cache::PERMANENT;
60 public function getCacheContexts() {