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
^ 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
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');
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
Comment