0

I am struggling to add javascript files only needed in particular view at bottom of my layout. What I am doing right now is I am using my controller code to decide what javascript file this view should use. I don't want to write any view logic in controller as I think I should keep all front end logic outside of controller.

Any idea?

Saurabh
  • 22,743
  • 12
  • 84
  • 133
  • what type of javascript files? Libraries, self-built function files? One way would be to create a helper that the controller includes, and you decide in the helper what files you need to include. Please paste some of your code and I can give a more detailed answer – cornelb Feb 19 '14 at 07:03
  • 3
    http://stackoverflow.com/questions/14084123/load-javascript-files-in-cakephp-layout-at-bottom – mirage Feb 19 '14 at 07:38

0 Answers0