zendframework / zend-expressive-zendviewrenderer

zend-view PhpRenderer integration for Expressive
BSD 3-Clause "New" or "Revised" License
11 stars 12 forks source link

NamespacedPathStackResolver - adding default suffix to template #28

Closed vaclavvanik closed 7 years ago

vaclavvanik commented 8 years ago

After a while of digging I find that NamespacedPathStackResolver do not add default suffix if I try to render eg: $template->render('mail::body.html', []); which should be imho resolved to body.html.phtml.

Is this bug or expected behavior?

geerteltink commented 8 years ago

You highlight the answer yourself.

        if (pathinfo($template, PATHINFO_EXTENSION) == '') {
            $template .= '.' . $defaultSuffix;
        }

What it does is it checks if there is already an extension. If there is none it appends $defaultSuffix. So in your example it detects .html as an extension and will not add .phtml.