Welcome Guest, Not a member yet? Register   Sign In
how to access directory under: application
#1

[eluser]Zulkhaery B[/eluser]
its newbie question,

i trying to save my system image, css and javascript under system/application directory (ie. application/images).

how can i access the images directory?
thx for your answer.

rgds,

Zul
#2

[eluser]obiron2[/eluser]
Code:
base_url().images/img.jpg

obiron
#3

[eluser]Zulkhaery B[/eluser]
[quote author="obiron2" date="1190652738"]
Code:
base_url().images/img.jpg

obiron[/quote]

that way, will go to http://mysite.com/images. My images directory under public_html/application/images. If i go to http://mysite.com/application/images, did not work.

-Zul
#4

[eluser]obiron2[/eluser]
doh!

You are right.

I created a helper which I always include with a function site_url() which returns "base_url() . application/".

then use site_url().images/img.jpg

you could of course include in the helper img_url(), css_url() etc..


You could put these in the config, but you would then lose them if you updated the CI installation.

hth

obiron
#5

[eluser]Matthew Pennell[/eluser]
Code:
global $application_folder;
$images_directory = base_url() . $application_folder . '/images';
$local_path = BASEPATH . $application_folder . '/images';
At least, I think the variable is called $application_folder, I might be wrong. But that's what you want, anyway. Smile
#6

[eluser]Zulkhaery B[/eluser]
oh, i forgot 'helper'. thanks, I'll trying

- Zul
#7

[eluser]wojtekk[/eluser]
saving images in 'system/application directory' is bad idea
its page engine and u shouldnt do that
'http://mysite.com/images'<-thats correct
#8

[eluser]Zulkhaery B[/eluser]
[quote author="wojtekk" date="1190655266"]saving images in 'system/application directory' is bad idea
its page engine and u shouldnt do that
'http://mysite.com/images'<-thats correct[/quote]

main reason is the image can be viewed as mysite.com/application/images/ on image property, right ?

if yes, my next question, is it possible using .htaccess to route public_html/application/images to public_html/images ? :gulp:




Theme © iAndrew 2016 - Forum software by © MyBB