CodeIgniter Forums
Adding custom css to CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Adding custom css to CI (/showthread.php?tid=67549)



Adding custom css to CI - bgclmc1 - 03-07-2017

I have seen several threads on this subject but none so far, helped.
I am rebuilding a native php/html/bootstrap site to CI as a first time CI user.

I am getting the message: The configuration file url.php does not exist. on loading my page (http://www.hdkumdo.com/swords/)
The underlying html is: <p>The configuration file url.php does not exist.</p> </div>

I am using the basic sample from the CI tutorial to create header/content/footer separation. Starting with the sample which worked,
I wanted to add elements of my own to the respective parts (header/footer etc) so step 1 was to include my css and some basic bootstrap code. I have not downloaded bootstrap, rather I have referred to a cdn in the header.php file, as follows: 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
which is followed by my css link, both of which are just prior to </head>
<link rel="stylesheet" href="<?php echo base_url("css/custom.css"); ?>" />

The directory structure is:
public_html->swords->css(custom.css)
I have also tried:
public_html->swords->assets/css(custom.css)

The problem seems to be related to php echo base_url() looking for a file called url.php and I don't understand why. It looks like 'url' comes from the contents of autoload but this is what a tutorial at http://www.kodingmadesimple.com/2014/06/integrate-twitter-bootstrap3-with-codeigniter-framework.html states is required.

I have:


- $config['base_url'] = 'http://www.hdkumdo.com/swords/'; in config.php
- $autoload['config'] = array('url'); in autoload.php
- a known working css file (works outside CI)

I have not done anything to .htaccess as I have used routing to remove the url parts for the index.php etc.

Thoughts would be greatly appreciated.
Cheers
Geoff


RE: Adding custom css to CI - Wouter60 - 03-07-2017

$autoload['config'] is not the correct way of loading the url helper! Change it to:
PHP Code:
$autoload['helper'] = array('url'); 
in your autoload.php file.


RE: Adding custom css to CI - bgclmc1 - 03-08-2017

Thank you very much. Clearly got confused between config and autoload.