CodeIgniter Forums
adding a view page in main view page - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: adding a view page in main view page (/showthread.php?tid=48077)



adding a view page in main view page - El Forum - 01-03-2012

[eluser]Unknown[/eluser]
Hi i'm fairly new to CI, currently working on making a menu where i am using ajax to change the body of the div (keeping menu the same). I am stuck on how to take another php file into my main php file (which contains my tabs). Below i have a simple sample of how i would process this....would this work? is it correct? If not how should i approach this?

Controller
Code:
<?php
class Blog extends CI_Controller {

function index()
{
  $data['title'] = <?php echo base_url();?>/method/function;
  

  $this->load->view('blogview', $data);
}
}
?>

Code:
<html>
<head>

</head>
<body>
<div id ="this"> &lt;title&gt;&lt;?php echo $title;?&gt;&lt;/title&gt;&lt;/div>
&lt;/body&gt;
&lt;/html&gt;