Attempt to load the templatePath.

@param string $templatePath

@return $this
486108
protected function loadTemplatePath($templatePath)
    {
        $templatePath = $this->path->getDir($templatePath);
        if (file_exists($templatePath)) {
            require $templatePath;
        }
        return $this;
    }
1373862
protected function findTemplate(string $templatesPath, string $package, string $templateName): string
    {
        if (!empty($package)) {
            // /templates/default/vendor/module/template.php
            $templatePath = 
                $templatesPath . 
                $this->config->templatesDefault . 
                '/' . strtolower($package) . 
                '/' . str_replace('.', '/', $templateName) . $this->extension;
            if (file_exists($templatePath)) {
                return $templatePath;
            }
        }
        
        // /templates/default/template.php
        $templatePath = 
            $templatesPath . 
            $this->config->templatesDefault . 
            '/' . str_replace('.', '/', $templateName) . $this->extension;
        return $templatePath;
    }
111142
public function load($path)
    {
        // Load template
        try {
            $template = $this->twig->loadTemplate($path);
        } catch (LoaderError $e) {
            throw new InvalidArgumentException("Error loading $path: ". $e->getMessage(), $e->getCode(), $e);
        }

        if ($template instanceof Template) {
            // Events are already fired by the View Environment
            $template->setFiredEvents(true);
        }

        return $template;
    }
1026194
private function twigLoad(string $path): ?\Twig_TemplateWrapper
    {
        try {
            return $this->twigEnv->load($path);
        } catch (TwigError $exc) {
            if (defined('WP_DEBUG') && WP_DEBUG) {
                throw $exc;
            }
        }
    }
342908
protected function generateContent($templatePath, $templateData)
    {
        $template = $this->getTemplate($templatePath);

        $content = $this->compile($template, $templateData);

        return $content;
    }
385988
public function setTemplatePathAndFilename($templatePathAndFilename)
    {
        $this->baseRenderingContext->getTemplatePaths()->setTemplatePathAndFilename($templatePathAndFilename);

        $partialRootPaths = $this->baseRenderingContext->getTemplatePaths()->getPartialRootPaths();
        $layoutRootPaths = $this->baseRenderingContext->getTemplatePaths()->getLayoutRootPaths();
        array_unshift($partialRootPaths, Files::concatenatePaths([dirname($templatePathAndFilename), 'Partials']));
        array_unshift($layoutRootPaths, Files::concatenatePaths([dirname($templatePathAndFilename), 'Layouts']));
        $this->baseRenderingContext->getTemplatePaths()->setPartialRootPaths($partialRootPaths);
        $this->baseRenderingContext->getTemplatePaths()->setLayoutRootPaths($layoutRootPaths);
    }
395427
public function setViewPath(string $basePath): self
    {
        $this->viewPath = $basePath;

        if (substr($this->viewPath, -1) != '/') {
            $this->viewPath .= '/';
        }

        return $this;
    }
409535
public function loadByTemplateByCode($templateCode)
    {
        $template = $this->templateCollectionFactory->create()
            ->addFieldToFilter('template_code', $templateCode)
            ->setPageSize(1);

        return $template->getFirstItem();
    }
636046
protected function resolveCachedTemplatePath($templatePath)
    {
        if (isset($this->paths[$templatePath])) {
            $path = $this->paths[$templatePath];
        } else {
            $path = $this->finder->find($templatePath);
            if (null === $path) {
                throw new RuntimeException(sprintf(
                    '%s is not a valid readable template',
                    $templatePath
                ));
            }
            $this->paths[$templatePath] = $path;
        }

        return $path;
    }
261561
public function templatesLoader(TemplateLoaderInterface $value = null)
    {
        if (null === $value) {
            return $this->templatesLoader;
        }
        $this->templatesLoader = $value;
        foreach ($this->commands as $name => $command) {
            $command->templatesLoader = $value;
        }
        return $this;
    }
707575
private function setTemplateFieldName(string $templateFieldName): self
    {
        $this->updatePropertyValue(
            TemplateFieldNameFieldInterface::PROP_TEMPLATE_FIELD_NAME,
            $templateFieldName
        );

        return $this;
    }
1210099
public function load($basePath)
    {
        $this->basePath = $basePath;
        $this->renderer = new Renderer($this->getViewsPath());

        return
            $this
                ->loadCustomTables()
                ->loadPostTypes()
                ->loadFieldGroups()
                ->loadAcfJson()
                ->loadActions()
                ->loadShortCodes()
                ->loadOptionScreens()
                ->loadCliCommands();
    }
1122849
protected function getTemplatePath()
    {
        if (!isset($this->templatePath)) {
            $this->templatePath = self::$config->templates[$this->template] . '/' . $this->name;
        }

        return $this->templatePath;
    }
111377
public function load(string $templatePath): TemplateInterface
    {
        $path = $this->resolveCachedTemplatePath($templatePath);
        $class = $this->generateTemplateCacheClass($path);

        return $this->compileAndSaveTemplate(
            $this->finder->getContents($path),
            $this->resolveCacheTemplatePath($class),
            $class
        );
    }
1080579
public function loadYamlFile($filePath)
    {
        if (file_exists($filePath)) {
            $this->loadYaml(file_get_contents($filePath));

            return $this;
        }

        return $this;
    }
1351904
public function bootstrap(?string $basePath = null): self
    {
        $this->createApplication($basePath);
        $this->baseKernelBinding();

        return $this;
    }
548751
public function setTemplate(string $template): self
    {
        $this->template = $template;
        $this->logger->debug("Template file set to loader.", ["template" => $this->template]);
        return $this;
    }