Currently, I am developing an application using the powerful combination of CakePHP
and AngularJS
.
During my work on the AngularJS side of the project, I noticed that we are generating a large number of JavaScript and HTML files.
I am interested in having these JavaScript/HTML files served from a CakePHP controller.
I envision it working like this:
When a request is made from the client side for a JS file, it would look something like this:
http://example.com/javascripts/file/jquery
In the above URL:
> **javascripts** represents the Controller name,
> **file** is the action within that controller,
Furthermore, I want the response to return the content of the jQuery
file located at "webroot/js/jquery.js" or another specified folder.
The same concept applies to HTML and CSS files as well.
Has anyone attempted this approach before?
I simply aim to manage all JS, HTML, and CSS files through the CakePHP controller.
If there are alternative solutions to achieve the same functionality, please share them...