CodeIgniter Users: best path for css / javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    CodeIgniter Users: best path for css / javascript

    I just picked CodeIgniter for a pet project just to learn yet another framework to put on my resume.

    Question I came up with while starting is in my previous framework, I could load a (by default) css, javascript file as well as any other file I wanted in that specific controller function.

    For example say I load global.css for every page on the site, but for my blog/comments page I have a specific css and or javascript file to load.

    Following the code architecture of code igniter, I assume something like this would work

    Code:
    $this->load->view->css(array('comment','foo')); 
    $this->load->view->jsc(array('comment','foo')); 
    
    // then when I go to load my view
    
    $this->load->view('comment');
    ^ that's the first question...to tag on to that. What if I want to have the frame of each page on the site the same (instead of footer/header) i'd have one global.html file and the interior of that file, some <div id="main_conten t"> would be loaded.

    In this way, the load->view('comment' ) wouldn't load comment.html, but load the comment.html and inserted in the main_content div in ...say..global. html

    Has anyone done anything like this? This will make management of HTML much easier and has saved me tons of hours in the past.

    eager to hear your thoughts,





    Dan
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Nevermind...fou nd it.



    Looks like I have alot of work to do, to get CI how I want it. *sigh* It's going to be a long night.






    Dan

    Comment

    • dgreenhouse
      Recognized Expert Contributor
      • May 2008
      • 250

      #3
      Yep... Although CI is probably the simplest and fastest PHP framework out there, it does require a bit of work - like anything else. It's kind of like C in that you have all the rope necessary to tie your boat to the harbor, raise the sails, or hang yourself from the crow's nest! :D

      Have fun!

      Comment

      Working...