You are here

protected function ViewsDuplicateBuilderBase::loadTemplate in Views Templates 8

Load template from service.

Parameters

mixed $options: The options to load template.

Return value

object Returns loaded template in object form.

3 calls to ViewsDuplicateBuilderBase::loadTemplate()
ViewsDuplicateBuilderBase::createView in src/Plugin/ViewsDuplicateBuilderBase.php
Create a View. Don't save it.
ViewsDuplicateBuilderBase::loadViewsTemplateValue in src/Plugin/ViewsDuplicateBuilderBase.php
Return value from template.
ViewsDuplicateBuilderBase::templateExists in src/Plugin/ViewsDuplicateBuilderBase.php
Check if template exists.

File

src/Plugin/ViewsDuplicateBuilderBase.php, line 122

Class

ViewsDuplicateBuilderBase
ViewsDuplicateBuilderBase Class.

Namespace

Drupal\views_templates\Plugin

Code

protected function loadTemplate($options) {
  if (empty($this->loadedTemplate)) {
    try {
      $template = $this->templateLoader
        ->load($this);
    } catch (FileNotFoundException $e) {
      watchdog_exception('views_templates', $e, $e
        ->getMessage());
      return NULL;
    }
    $this
      ->alterViewTemplateAfterCreation($template, $options);
    $this->loadedTemplate = $template;
  }
  return $this->loadedTemplate;
}