File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -498,6 +498,9 @@ public function findLayoutTemplateFile()
498
498
*/
499
499
public function formatLayoutTemplateFiles ()
500
500
{
501
+ if (preg_match ('#/| \\\\# ' , $ this ->layout )) {
502
+ return [$ this ->layout ];
503
+ }
501
504
list ($ module , $ presenter ) = Helpers::splitName ($ this ->getName ());
502
505
$ layout = $ this ->layout ? $ this ->layout : 'layout ' ;
503
506
$ dir = dirname ($ this ->getReflection ()->getFileName ());
Original file line number Diff line number Diff line change @@ -64,3 +64,13 @@ test(function () { // with module & without subdir templates
64
64
dirname (dirname (__DIR__ )) . '/templates/@layout.latte ' ,
65
65
], $ presenter ->formatLayoutTemplateFiles ());
66
66
});
67
+
68
+
69
+ test (function () { // direct file
70
+ $ presenter = new Presenter2 ;
71
+ $ presenter ->setLayout (__DIR__ . '/file.latte ' );
72
+
73
+ Assert::same ([
74
+ __DIR__ . '/file.latte '
75
+ ], $ presenter ->formatLayoutTemplateFiles ());
76
+ });
You can’t perform that action at this time.
0 commit comments