FOF30\View\View::loadTemplate PHP Method

loadTemplate() public method

Our function uses loadAnyTemplate to provide smarter view template loading.
public loadTemplate ( string $tpl = null, boolean $strict = false ) : mixed
$tpl string The name of the template file to parse
$strict boolean Should we use strict naming, i.e. force a non-empty $tpl?
return mixed A string if successful, otherwise an Exception
    public function loadTemplate($tpl = null, $strict = false)
    {
        $result = '';
        $uris = $this->viewFinder->getViewTemplateUris(array('component' => $this->container->componentName, 'view' => $this->getName(), 'layout' => $this->getLayout(), 'tpl' => $tpl, 'strictTpl' => $strict));
        foreach ($uris as $uri) {
            try {
                $result = $this->loadAnyTemplate($uri);
                break;
            } catch (\Exception $e) {
                $result = $e;
            }
        }
        if ($result instanceof \Exception) {
            $this->container->platform->raiseError($result->getCode(), $result->getMessage());
        }
        return $result;
    }