Skip to content

Tag: cakephp

How to get complete current url for Cakephp

How do you echo out current URL in Cake’s view? Answer You can do either From a view file: Which will give you the absolute url from the hostname i.e. /controller/action/params Or which should give you the full url with the hostname.

Cakephp: how to pass values into a javascript file?

I have some javascript that is being included in a view and I used inkedmn’s method in this thread: adding-page-specific-javascript-to-each-view-in-cakephp So I now have the following code in my view: But I need to pass some values from the view into the javascript file and I’m unsure of how to ac…