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()
498498 */
499499 public function formatLayoutTemplateFiles ()
500500 {
501+ if (preg_match ('#/| \\\\# ' , $ this ->layout )) {
502+ return [$ this ->layout ];
503+ }
501504 list ($ module , $ presenter ) = Helpers::splitName ($ this ->getName ());
502505 $ layout = $ this ->layout ? $ this ->layout : 'layout ' ;
503506 $ 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
6464 dirname (dirname (__DIR__ )) . '/templates/@layout.latte ' ,
6565 ], $ presenter ->formatLayoutTemplateFiles ());
6666});
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