Welcome Guest, Not a member yet? Register   Sign In
loading view into another view?
#1

[eluser]nuttynibbles[/eluser]
hi,

i would like to load view into another view file.

e.g:

View files:
These are the 3 view files that will be called on every controller. They are the basic templates.
header.php
index.php
footer.php

index.php will look like this. So basically i include header.php and footer.php into index.php:
Code:
<?php    
include_once('header.php');
?>
<tr>
    <td>
    &lt;!--content--&gt;
    <table class="table_main">
        <tr><td class="td_roundertop"></td></tr>
        <tr><td class="td_content"><br />&lt;?=$content ?&gt;</td></tr>
        <tr><td class="td_rounderbottom"></td></tr>
    </table>
    </td>
</tr>
<tr><td style="height:10px;"></td></tr>
&lt;?php include_once('footer.php'); ?&gt;

this is how i will call them in the controller:
$this->data['content']="hello world";
$this->load->view('index',$this->data);

$this->data['content'] will contain the different forms or tables that will be displayed.

Therefore, register form, login form, edit profile form and etc etc, i would like to put them into view files too. For example, the files are:
register.php
login.php
editprofile.php

so now i would like to call this reigster.php view file and put them into $this->data['content'].

How can I do this? or anyone with a different idea to go about this?

Thks


Messages In This Thread
loading view into another view? - by El Forum - 05-18-2008, 03:31 AM
loading view into another view? - by El Forum - 05-18-2008, 04:53 AM
loading view into another view? - by El Forum - 05-18-2008, 05:00 AM
loading view into another view? - by El Forum - 05-18-2008, 05:25 AM
loading view into another view? - by El Forum - 05-21-2008, 11:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB