1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

CSS is not working with Codeigniter Framework

Discussion in 'CSS' started by digi_media, Jun 13, 2015.

  1. #1
    CSS is not working with the CodeIgniter Framework even after loading the "healper('url'); and helper('html');" and using link_tag. Even I have used base_url.
    The following code is in Views folder
    <?php
    
    $link = array(
            'href'  => 'application/views/CSS/main.css',
            'rel'   => 'stylesheet',
            'type'  => 'text/css',
            );
    echo link_tag($link);
    ?>
    
    </head>
    PHP:
    Someone please help...:eek:
     
    digi_media, Jun 13, 2015 IP
  2. Phil S

    Phil S Member

    Messages:
    60
    Likes Received:
    18
    Best Answers:
    4
    Trophy Points:
    35
    #2
    This is not a CSS problem, this is a broken methodology problem.

    First of all, check whether that (silly) bit of code actually prints what you demand and verify the target, i.e. if the HREF attribute is pointing at the right location.

    The question I'm tempted to ask here is -- WHY? What purpose does that PHP serve in this particular case? Given that you're already specifying the full path, there's probably zero reason to be doing what you're doing there.
    Also, you should really declare the MEDIA attribute on your LINK.

    On a side note, here's the description of that framework you're using. Please don't laugh at me for not knowing what Codeigniter was until now, but I really do not get to point of using a framework of a framework. It's a little redundant IMHO.

    That right there is DO-NOT-TOUCH sign for me.
     
    Phil S, Jun 14, 2015 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #3
    ... and people wonder why I call PHP frameworks bullshit. If you don't realize how unbelievably STUPID that code is, you probably shouldn't be creating HTML or PHP.

    Also wouldn't hurt to properly state a MEDIA target...
     
    deathshadow, Jun 14, 2015 IP
  4. digi_media

    digi_media Active Member

    Messages:
    99
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    68
    #4
    OK, finally I found the reason. The code-igniter framework 3.0 is not stable version, using 2.0 solved the problem.
     
    digi_media, Jun 21, 2015 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    It still hasn't fixed the problem of having used it in the first place. :D

    cheers,

    gary
     
    kk5st, Jun 21, 2015 IP
    deathshadow likes this.
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    I should also point out that coming back to the forum to explain the cause and the fix is showing proper netiquette. For that, thank you. You done good.

    cheers,

    gary
     
    kk5st, Jun 21, 2015 IP
    deathshadow likes this.
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #7
    That was nice to see, just in case someone ends up here with the exact same problem. I hate it when people just say "fixed", don't bother telling us it's fixed, or worse, delete the contents of the original post once it is "fixed".
     
    deathshadow, Jun 21, 2015 IP