[eluser]Fumigator[/eluser]
Hi there, I'm just getting into CI and am enjoying it so far. Initially I had some trouble with how paths are set up, but some searches of this forum and the user guide have cleared most of it up.
So now, I'm wondering: How do most people set up asset paths? Is there a "best way"? For now I've created folders in the root as siblings to CI's "system" folder, and that works OK, as long as I use base_url() when pointing to assets. But I do admit, it kind of bugs me to use an absolute path; I've always used relative paths because as we all know, you don't want to break all of your links if environments change. (Of course, in the past, using a relative path meant I _had_ to had my "img" folder as a child right under my root folder, so that's not exactly flexible, so perhaps using base_url() is an improvement!)
Next, I love using jQuery's AJAX functions. Before CI, my AJAX calls refer to my PHP files using relative path. Now though, I need to get the value returned by base_url() into my Javascript script I suppose. I've thought I can stick a < script > code block inside my view, which loads values into global Javascript variables that contain the paths to my PHP files, and then I can use these global variables in my Javascript. Is this "best practice", or is there a better way?