I have a code like that:
$view = new Mvc\View();
$view->setViewsDir([$path1, $path2, $path3]);
$view->partial('test/template');
In that case if template 'test/template' exists in all folders, than all of them will be shown. How to limit it and display only 1st ?
I'm using small "workaround":
$view = new Mvc\View();
foreach([$path1, $path2, $path3] as $viewPath){
$view->setViewsDir($viewPath);
if($view->exists('test/template')){ break; }
}
$view->partial('test/template');
However, maybe exists any better (native) way?
Thank you.