Why are there two “vendors” folders in CakePHP?
You probably noticed that there are two “vendors” folders in CakePHP: one is directly in the root and the other in the “app” folder. So, why are there two such folders? It is simple. The “vendors” folder in the “app” folder is for application-specifc third-party libraries whereas the other “vendors” folder is for libraries you want to use in multiple applications.




Also, the root vendors folder has js/ and css/ folders that allow you to store JavaScript and CSS files that are globally available to all applications, just as if they were in webroot/js or webroot/css. And since the files are served through PHP, you can embed PHP code in them.
Hello Nate,
Since what version of CakePhp for this improvements ?
Can you give me some examples how to embed PHP code in CSS files and how to call css or js from vendors folders ?
Thanks,
Nao
The feature has been there for a couple months. Loading JS and CSS files from vendors is seamless. It’s the exact same as loading JS or CSS files from webroot.
And for embed PHP code in them ?
I have make a file “test.js” in root vendors folder but file are not loaded :
link(’test’); ?>
Try addressing your questions to the mailing list.
[...] Here’s the answer for them [...]
[...] Here’s the answer for them [...]