55use Exception ;
66use Illuminate \Support \Facades \View ;
77use Kirby \Cms \App ;
8- use Kirby \Template \Template as KirbyTemplate ;
98use Kirby \Filesystem \F ;
9+ use Kirby \Template \Template as KirbyTemplate ;
1010use Kirby \Toolkit \Tpl ;
1111
1212class Template extends KirbyTemplate
1313{
1414 public const EXTENSION_BLADE = 'blade.php ' ;
15+
1516 public const EXTENSION_FALLBACK = 'php ' ;
1617
1718 protected string $ templatesPath ;
19+
1820 protected string $ viewsPath ;
21+
1922 protected ?string $ extension = null ;
2023
2124 public function __construct (App $ kirby , string $ name , string $ type = 'html ' , string $ defaultType = 'html ' )
@@ -78,7 +81,7 @@ public function file(): ?string
7881 if ($ this ->type () === 'blade ' ) {
7982 return null ;
8083 } else {
81- $ name = $ this ->name () . " . " . $ this ->type ();
84+ $ name = $ this ->name (). ' . ' . $ this ->type ();
8285 }
8386
8487 return $ this ->getFilename ($ name );
@@ -88,14 +91,14 @@ public function getFilename(string $name): ?string
8891 {
8992 try {
9093 // Try the default blade template in the default template directory.
91- return F::realpath ("{$ this ->templatesPath }/ {$ name }. " . self ::EXTENSION_BLADE , $ this ->templatesPath );
94+ return F::realpath ("{$ this ->templatesPath }/ {$ name }. " . self ::EXTENSION_BLADE , $ this ->templatesPath );
9295 } catch (Exception ) {
9396 // ignore errors, continue searching
9497 }
9598
9699 try {
97100 // Try the default vanilla php template in the default template directory.
98- return F::realpath ("{$ this ->templatesPath }/ {$ name }. " . self ::EXTENSION_FALLBACK , $ this ->templatesPath );
101+ return F::realpath ("{$ this ->templatesPath }/ {$ name }. " . self ::EXTENSION_FALLBACK , $ this ->templatesPath );
99102 } catch (Exception ) {
100103 // ignore errors, continue searching
101104 }
0 commit comments