Controller:
$data = array(); $page['left_content'] = $this->load->view('left_content', $data, TRUE); $page['main_content'] = $this->load->view('left_content', $data, TRUE); $page['right_content'] = $this->load->view('left_content', $data, TRUE); $this->load->view('home',$data);
View:
<body> <?php if(isset($left_content)){echo $left_content;}?> <?php if(isset($main_content)){echo $main_content;}?> <?php if(isset($right_content)){echo $right_content;}?> </body>
Pay attention to the code above. This code is used to view the page on the main page. Now just pass the test. If we just remove TRUE from the code, the code does not work properly. This means that when we delete it, the view does not print itself in the right place. it prints itself at the top of the main window or main home page. I have a lot of googled, but can't find a reason to use it. I just want to know why we just use TRUE in this code? Thnx
source share