Welcome Guest, Not a member yet? Register   Sign In
I'm tasked with using relative file referencing. Is that even possible w/ CI??
#4

[eluser]Michael Wales[/eluser]
I was about to say, referencing from root, ie:
Code:
<img src="/foo.gif" />
is relative.

You could always count the number of uri->segments() there are, and append that number of ../ to the beginning of the filename. Why is a client forcing you to do this? Easily the most retarded thing I've ever heard, I'd drop the job right there if someone told me to do this - no benefit, more work for you, and the potential for major issues in the future.

Regardless, make a helper to do the count and replace as I said earlier, and append that to the beginning of all URLs you want relative
Code:
<img src="&lt;?= retarded_helper($this->uri->total_segments()); ?&gt;/foo.gif" />


Messages In This Thread
I'm tasked with using relative file referencing. Is that even possible w/ CI?? - by El Forum - 10-19-2007, 10:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB