You are here

protected function MaestroEngineTemplateFilter::generateTemplateOptions in Maestro 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/filter/MaestroEngineTemplateFilter.php \Drupal\maestro\Plugin\views\filter\MaestroEngineTemplateFilter::generateTemplateOptions()

Generate the options for this template.

File

src/Plugin/views/filter/MaestroEngineTemplateFilter.php, line 51

Class

MaestroEngineTemplateFilter
Filter for Maestro Template names.

Namespace

Drupal\maestro\Plugin\views\filter

Code

protected function generateTemplateOptions() {
  $templates = MaestroEngine::getTemplates();
  $options = [];
  $options[0] = $this
    ->t(' - Any -');
  foreach ($templates as $machine_name => $template) {
    $options[$machine_name] = $template->label;
  }
  return $options;
}