CodeIgniter Forums
CodeIgniter 4 Pre-Alpha 1: $viewPath - make it multiple - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: CodeIgniter 4 Pre-Alpha 1: $viewPath - make it multiple (/showthread.php?tid=65562)



CodeIgniter 4 Pre-Alpha 1: $viewPath - make it multiple - ivantcholakov - 06-26-2016

CodeIgniter 4 Pre-Alpha 1
class CodeIgniter\View\View

The constructor contains the parameter string $viewPath=null. This means that only one path to be scanned for a searched view is allowed.

I think that more flexibility will be achieved if the class is capable to scan several directories until it finds a matching view. So the parameter $viewPath could be an array. Also, additional methods addPath() and prependPath() could be added.


RE: CodeIgniter 4 Pre-Alpha 1: $viewPath - make it multiple - kilishan - 06-26-2016

Originally, my thought was that by being able to specify a "namespace" with it, you wouldn't need multiple path support. I can see how it might be handy, though, so I guess I'm on the fence about this one at the moment. We'll see what others say before making any changes.