Using Jquery in CakePHPPosted: May 1, 2011
In case you need to use jquery in cakephp. (not really ‘in case’, but more of ‘use it!’)
3 Things you need to take care of.
- In your App Controller (if you want to use it for the whole app else you can put it at a specific controller)
- In your default layout or your view
I’m using google’s CDN for my jquery js file
- Test if your jquery works. Place this in your view (.ctp) file.
alert(“Thanks for visiting!”);