Saturday, May 1, 2010

Re: Defining constants like APP for use in javascript

On May 1, 1:49 pm, fly2279 <kennethf...@gmail.com> wrote:
> Has anyone done something like declaring cake's constants in a
> javascript file for use in all javascript files created for the app? I
> keep wondering what approach I should take for things like a path that
> might change depending on where the app is installed. Should I just
> set a variable to APP and serve the javascript file blended with php
> so that I can access it in other included javascript files? How does
> everyone else do it?

I'm not really clear on what you mean - but I include this js file (js
files which cake serves - i.e. not directly in the webroot - can
include php logic) http://github.com/AD7six/mi_js/blob/master/jquery.mi.js
which allows your js code to know if it's running in a subfolder

if that doesn't help a description of what you're trying to do would
likely get you help.

hth,

AD
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: