efabrica-team / phpstan-latte

PHPStan extension to check compiled latte templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Standalone presenter action template is not analysed if presenter dir and template dir are siblings

lulco opened this issue · comments

Does this even work in Nette? I think action templates should be in same folder as presenter or in templates sub-folder. Or does it work for different locations too?

I have project with structure:

presenters
  FooPresenter.php
templates
  Foo
    add.latte
    default.latte

and it seems working. I have to check if this is standard way in nette

I think this code block is responsible for it:

$dir = is_dir("$dir/templates") ? $dir : dirname($dir);

       $templateFileCandidates = [
           $dir . '/templates/' . $presenterName . '/' . $actionName . '.latte',
           $dir . '/templates/' . $presenterName . '.' . $actionName . '.latte',
       ];

This is from our extension but I copied it from Nette.