![]() |
nested views - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: nested views (/showthread.php?tid=42644) |
nested views - El Forum - 06-14-2011 [eluser]Siyavash[/eluser] Hi I have started using CI for about 3 weeks and now I have faced a problem . The exact problem is as follows : I need to load a view file that could be able to load another view file itself. to be more accurate , suppose you have a header, a content and a footer and you want to load a view file in content and the loaded view file contains a link that when clicked updates a part of content (suppose content div is consist of 2 divs) how can I do that ? sending a $this->load->view() as a parameter is not the answer I know, but what is the solution ? nested views - El Forum - 06-14-2011 [eluser]bubbafoley[/eluser] you can load views from other views but I would do something like this controller Code: $data['header'] = $this->load->view('header', '', TRUE); content view Code: <?php echo $header ?> nested views - El Forum - 06-14-2011 [eluser]Siyavash[/eluser] thanks for your quick reply. But I knew that i could use that method. let me clarify my question. suppose you have loaded the header and now (after loading the whole parts) you want to load another view in a div tag inside the header. I thought maybe i should use AJAX or something like that. CI itself doesn't support such thing. Am I right ? nested views - El Forum - 06-14-2011 [eluser]bubbafoley[/eluser] yes you need to use javascript to change the content after the page is loaded. nested views - El Forum - 06-14-2011 [eluser]Siyavash[/eluser] Thanks then! |