Jump to content

CSS files and images, where will I place this folder?


booxvid

Recommended Posts

I'm just a newbie with this CodeIgniter framework and I'm currently working on a simple registration form.

Right now, I have a difficulty in displaying css designs.

 

Where would be my css folder will be placed that can have a short location in placing the href tag?

 

Somewhere in your views directory.  I pretty much copy/paste this into my MY_model class.

 

//special routes
define('ADMINCP', 'admincp/');
define('WIDGETS', 'application/widgets/');

// theme url defined
define('THEME_URL', base_url() . 'application/views/' );

// places to find assets
define('CSS', THEME_URL . 'assets/css/');
define('LESS', THEME_URL . 'assets/less/');
define('FONTS', THEME_URL . 'assets/fonts/');
define('JS', THEME_URL . 'assets/js/');
define('IMAGE', THEME_URL . 'assets/images/');

// reference to views from controllers
define('SITE', 'templates/public/');
define('ADMIN', 'templates/admincp/');
define('WIDGET', 'templates/widgets/');

// full http link for images
define('IMAGES', base_url() . 'application/views/images/');

 

Then you can use them in your header template like thusly:

<link rel="stylesheet/css" type="text/css" href="<?php echo JS; ?>jquery-ui-1.8.21.custom.css">
<?php echo link_tag(CSS . 'style.css'); ?> 

 

In case that doesn't give you enough clues about directory structure:

Dk0T.png

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.