public function findTemplate(string $name): string
    {
        if ($this->files->has($name)) {
            return $name;
        }

        $name = $this->normalizeName($name);

        if (isset($this->cache[$name])) {
            return $this->cache[$name];
        }

        try {
            $found              = $this->finder->find($name);
            $this->cache[$name] = $found['path'];
        } catch (InvalidArgumentException $exception) {
            throw new LoaderError($exception->getMessage());
        }

        return $this->cache[$name];
    }
public function findTemplate(string $name): string
    {
        if ($this->files->has($name)) {
            return $name;
        }

        $name = $this->normalizeName($name);

        if (isset($this->cache[$name])) {
            return $this->cache[$name];
        }

        try {
            $found              = $this->finder->find($name);
            $this->cache[$name] = $found['path'];
        } catch (InvalidArgumentException $exception) {
            throw new LoaderError($exception->getMessage());
        }

        return $this->cache[$name];
    }
public function findTemplate ( string $ name ) : string { if ( $ this -> files -> has ( $ name ) ) { return $ name ; } $ name = $ this -> normalizeName ( $ name ) ; if ( isset ( $ this -> cache [ $ name ] ) ) { return $ this -> cache [ $ name ] ; } try { $ found = $ this -> finder -> find ( $ name ) ; $ this -> cache [ $ name ] = $ found [ 'path' ] ; } catch ( InvalidArgumentException $ exception ) { throw new LoaderError ( $ exception -> getMessage ( ) ) ; } return $ this -> cache [ $ name ] ; }
Return path to template without the need for the extension.

@param string $name

@throws \Twig\Error\LoaderError

@return string
Return path to template without the need for the extension .