Welcome Guest, Not a member yet? Register   Sign In
Using CSS With CodeIghiter
#1

[eluser]lenswipe[/eluser]
Hey guys

Im just trying to use CSS with my view files, i read http://codeigniter.com/wiki/css/ and it sort of works, except that it produces:
Code:
<link rel="stylesheet" href='http://localhost/helpdesk/css/style.css' type="text/css" media="screen" />

my actual css file is located in http://localhost/helpdesk/application/vi.../style.css i could hard code this in but i dont want to...

I could also just change the base_url option in config.php but i dont want to incase that breaks stuff..


can someone help?
#2

[eluser]jtrainaldi[/eluser]
I typically have my Javascript and CSS folders outside the application directory. I dont' know if that is best practice but you will then be able to utilize the base_url() function without changing it to accomodate your current setup.

-application
-config
-controller
-...
-...
-css
-js
-system
#3

[eluser]lenswipe[/eluser]
[quote author="jtrainaldi" date="1302891637"]I typically have my Javascript and CSS folders outside the application directory. I dont' know if that is best practice but you will then be able to utilize the base_url() function without changing it to accomodate your current setup.

-application
-config
-controller
-...
-...
-css
-js
-system[/quote]

thanks, i might pass up on doing that myself as i prefer to keep all my frontend stuff in the views folder, for convention
#4

[eluser]InsiteFX[/eluser]
Code:
application
system
assets
-- css
-- js
-- scripts
-- img
-- images
index.php

<link rel="stylesheet" href="<?php echo base_url();?>assets/css/style.css" type="text/css" media="screen" />

InsiteFX
#5

[eluser]William Rufino[/eluser]
You should use your app folder outside the public_html folder........ thats why you should have a public/assets folder
#6

[eluser]Nur Cholikul Anwar[/eluser]
Please check .htaccess on your application folder, maybe set "deny all"?
#7

[eluser]InsiteFX[/eluser]
It's to deny all for a reason!
#8

[eluser]Nur Cholikul Anwar[/eluser]
Thats i think, maybe you can remove .htaccess file




Theme © iAndrew 2016 - Forum software by © MyBB