Skip to content

Commit 1a708f2

Browse files
Remove support for plain .php template files (#907)
* Remove .php support for views * refactor Signed-off-by: Sam Poyigi <[email protected]> Co-authored-by: Sam Poyigi <[email protected]>
1 parent 680704f commit 1a708f2

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

app/main/template/ComponentPartial.php

+11-13
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,17 @@ public function getFilePath($fileName = null)
174174
$component = $this->component;
175175
$componentPath = $component->getPath();
176176

177-
foreach (['.blade.', '.'] as $part) {
178-
$basename = $fileName;
179-
if (!strlen(File::extension($basename)))
180-
$basename .= $part.$this->defaultExtension;
181-
182-
if (File::isFile($path = $componentPath.'/'.$basename))
183-
return $path;
184-
185-
// Check the shared "/partials" directory for the partial
186-
$sharedPath = dirname($componentPath).'/partials/'.$basename;
187-
if (File::isFile($sharedPath)) {
188-
return $sharedPath;
189-
}
177+
$basename = $fileName;
178+
if (!strlen(File::extension($basename)))
179+
$basename .= '.blade.'.$this->defaultExtension;
180+
181+
if (File::isFile($path = $componentPath.'/'.$basename))
182+
return $path;
183+
184+
// Check the shared "/partials" directory for the partial
185+
$sharedPath = dirname($componentPath).'/partials/'.$basename;
186+
if (File::isFile($sharedPath)) {
187+
return $sharedPath;
190188
}
191189

192190
return $componentPath.'/'.$fileName;

app/system/traits/ViewMaker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ trait ViewMaker
4545
*/
4646
public $suppressLayout = FALSE;
4747

48-
protected $viewFileExtension = ['.blade.php', '.php'];
48+
protected $viewFileExtension = ['.blade.php'];
4949

5050
public function getViewPath($view, $viewPath = null)
5151
{

0 commit comments

Comments
 (0)