Describe the bug
If there's only one viewsDir and more than one renderEngines registered, then getActiveRenderPath() only returns the path with the extension of the first registered renderEngine.
To Reproduce
// during setup of the view service (simplified):
$view->setRenderPath([
'/path/to/modules'
]);
$view->registerEngines([
'.volt' => $volt, // Phalcon\Mvc\View\Engine\Volt
'.phtml' => $php // Phalcon\Mvc\View\Engine\Php
]);
// ...
then when catching the view:notFoundView event:
public function notFoundView($event)
{
$notFound = $event->getSource()->getActiveRenderPath();
if (is_array($notFound))
{
// ...
}
// more dots...
}
But $notFound never is an array with such setup and only contains (string) '/path/to/modules/moduleName/views/missing_file.volt' while when dumping $view there are both absolute paths with each extension.
This behavior is very obvious in View.zep on Lines 337-341
Setting the renderPath twice to bypass this behavior also duplicates the activeRenderPaths
Expected behaviorgetActiveRenderPath(): array|string should either really return all possible paths independend from the num of viewDirs, or could get a flag to return the protected variable as it is.
Describe the bug If there's only one viewsDir and more than one renderEngines registered, then getActiveRenderPath() only returns the path with the extension of the first registered renderEngine.
To Reproduce
then when catching the view:notFoundView event:
But $notFound never is an array with such setup and only contains (string) '/path/to/modules/moduleName/views/missing_file.volt' while when dumping $view there are both absolute paths with each extension.
This behavior is very obvious in View.zep on Lines 337-341
Setting the renderPath twice to bypass this behavior also duplicates the activeRenderPaths
Expected behavior getActiveRenderPath(): array|string should either really return all possible paths independend from the num of viewDirs, or could get a flag to return the protected variable as it is.
Details Phalcon 5.6.1 on PHP 8.3.8