src/Theme.php
public function load(string $file): string
    {
        if ($this->childTheme && file_exists($this->themePath . '/' . $this->childTheme['name'] . $file)) {
            $this->preventDirectoryTraversal(
                $this->themePath . '/' . $this->childTheme['name'],
                $this->themePath . '/' . $this->childTheme['name'] . $file
            );

            return $this->themePath . '/' . $this->childTheme['name'] . $file;
        }

        if (!file_exists($this->themePath . '/' . $this->theme['name'] . $file)) {
            throw new NotFoundException('The template file (`' . $file . '`) could not be found in the theme.');
        }

        $this->preventDirectoryTraversal(
            $this->themePath . '/' . $this->theme['name'],
            $this->themePath . '/' . $this->theme['name'] . $file
        );

        return $this->themePath . '/' . $this->theme['name'] . $file;
    }
public function load(string $file): string
    {
        if ($this->childTheme && file_exists($this->themePath . '/' . $this->childTheme['name'] . $file)) {
            $this->preventDirectoryTraversal(
                $this->themePath . '/' . $this->childTheme['name'],
                $this->themePath . '/' . $this->childTheme['name'] . $file
            );

            return $this->themePath . '/' . $this->childTheme['name'] . $file;
        }

        if (!file_exists($this->themePath . '/' . $this->theme['name'] . $file)) {
            throw new NotFoundException('The template file (`' . $file . '`) could not be found in the theme.');
        }

        $this->preventDirectoryTraversal(
            $this->themePath . '/' . $this->theme['name'],
            $this->themePath . '/' . $this->theme['name'] . $file
        );

        return $this->themePath . '/' . $this->theme['name'] . $file;
    }
public function load ( string $ file ) : string { if ( $ this -> childTheme && file_exists ( $ this -> themePath . '/' . $ this -> childTheme [ 'name' ] . $ file ) ) { $ this -> preventDirectoryTraversal ( $ this -> themePath . '/' . $ this -> childTheme [ 'name' ] , $ this -> themePath . '/' . $ this -> childTheme [ 'name' ] . $ file ) ; return $ this -> themePath . '/' . $ this -> childTheme [ 'name' ] . $ file ; } if ( ! file_exists ( $ this -> themePath . '/' . $ this -> theme [ 'name' ] . $ file ) ) { throw new NotFoundException ( 'The template file (`' . $ file . '`) could not be found in the theme.' ) ; } $ this -> preventDirectoryTraversal ( $ this -> themePath . '/' . $ this -> theme [ 'name' ] , $ this -> themePath . '/' . $ this -> theme [ 'name' ] . $ file ) ; return $ this -> themePath . '/' . $ this -> theme [ 'name' ] . $ file ; }
Loads a file from the theme

This method will first try to load the file from the child theme (if available)

@param string $file The file to load (relative to the theme directory)

@return string The filename to load

@throws \CodeCollab\Theme\NotFoundException When the file cannot be found in either the theme or the child theme
Loads a file from the theme