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?

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.