Help for accessing external css....... |
[eluser]raiser[/eluser]
I need to access the external css that i defined. I tried to access but i can't.. I am very new to Codeigniter. My view code is, Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Then my controller is, Code: class Register extends CI_controller{ One more thing, the base_url() is , Code: $config['base_url'] = 'http://localhost/CodeIgniter_2.0.1/application'; I will be very grateful to you if you solve this issue. I cannot move to the next step. So Please help me
[eluser]InsiteFX[/eluser]
Also one problem may be the periods in the _2.0.1 Try this now! Code: // base_url should have the ending / on it InsiteFX
[eluser]Piter[/eluser]
See the html code which link you to generate and then you have access to this file.
[eluser]raiser[/eluser]
Dear InsiteFX, I tried your code.. But still i cant get it.. i searched the entire forum. I didnt find any thread related this. Pls help me to solve this. I cant move to the next step without this..
[eluser]soupli[/eluser]
The problem must be in your config or some kind. Because i tried your code and i get the css with no problem. Try to put all your files in another directory, like: Code: http://localhost/codeigniter/ci/
[eluser]InsiteFX[/eluser]
Did you change your directoy name to get rid of the periods? InsiteFX
[eluser]louisl[/eluser]
I think your base url should be :- Code: $config['base_url'] = 'http://localhost/CodeIgniter_2.0.1/'; Code: http://localhost/CodeIgniter_2.0.1/application/views/css/style.css
[eluser]andyy[/eluser]
Base url should match the directory where the index.php is stored and by the look of your folder names, you haven't moved anything around. Do what louisl said: set $config['base_url] to http://localhost/CodeIgniter_2.0.1/ and change your stylesheet href to application/views/css/style.css. I recommend you create a folder in your root named something like 'assets' or 'content' and place all your css, images and javascript inside. Storing css in the application folder is unorthodox and displays your application folder path which someone could attempt to target. I also noticed in your post, you said 'external css'. Do you mean a css file saved on your server, or another server? External usually means outside of your environment. Also using site_url() instead can provide a cleaner looking statement: Code: <link rel="stylesheet" type="text/css" href="<?php echo site_url('views/css/style.css'); ?>" media="screen" />
[eluser]InsiteFX[/eluser]
He still has not done what I said! Change the Directory name and get rid of the Periods ...... Windows may like them but CodeIgniter and Apache will not! InsiteFX
[eluser]andyy[/eluser]
@InsiteFX: That isn't the case. As proof, I just tested periods in the folder/pathname on my Windows box and my Ubuntu box both running Apache 2.2.11 with no problems... |
Welcome Guest, Not a member yet? Register Sign In |