Welcome Guest, Not a member yet? Register   Sign In
Structuring views ... am I going correct ?
#1

[eluser]CARP[/eluser]
Hi guys
I'm trying to clean my first ci app's code, and well, I begun loading views in this way...

Code:
<? $this->load->view('admin/admin_header.php'); ?>    
<!-- HTML CODE FOR ACTUAL VIEW FILE -->
<? $this->load->view('admin/admin_footer.php'); ?>

but I had previously this

Code:
//inside some_controller.php ...
    $this->load->view('admin/admin_header.php');
    $this->load->view('admin/admin_login.php');
    $this->load->view('admin/admin_footer.php');

and this 3rd way

Code:
//inside some_controller.php ...
    $data['header'] = $this->load->view('admin/admin_header.php');
    $data['footer'] = $this->load->view('admin/admin_footer.php');
    $this->load->view('admin/admin_login.php',$data);

Which one of the above methods is the best way to do this? Personally, for me, the best choice is the 1st one, but I don't know if doing this isn't very advisable for CI apps...

Thanks a lot in advance...


Messages In This Thread
Structuring views ... am I going correct ? - by El Forum - 06-25-2008, 07:25 AM
Structuring views ... am I going correct ? - by El Forum - 06-25-2008, 07:32 AM
Structuring views ... am I going correct ? - by El Forum - 06-25-2008, 08:03 AM
Structuring views ... am I going correct ? - by El Forum - 06-25-2008, 08:12 AM
Structuring views ... am I going correct ? - by El Forum - 06-25-2008, 10:45 AM
Structuring views ... am I going correct ? - by El Forum - 06-25-2008, 11:29 AM
Structuring views ... am I going correct ? - by El Forum - 06-25-2008, 11:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB