Welcome Guest, Not a member yet? Register   Sign In
__destruct and outputting views
#1

[eluser]TheLizardKing[/eluser]
I am trying to output a view using PHP5's __destruct in an attempt to create a header/content/footer setup.

Code:
<?php

class Links extends Controller {
  function __construct() {
    parent::Controller();

    $this->load->view('common/header');
  }
  
  function index() {
    $this->hot();
  }
  
  function hot() {
    $this->load->view('links/hot');
  }
  
  function __destruct() {
    $this->load->view('common/footer');
  }
}

When ran my output is always the content of common/header.php then links/hot.php then nothing. I can echo out text in my destructor but my view never outputs. I know the view is good because I can place it anywhere else. Am I mistaken on how the destructor works? What is a good work around?


Messages In This Thread
__destruct and outputting views - by El Forum - 01-15-2009, 10:16 AM
__destruct and outputting views - by El Forum - 01-15-2009, 10:42 AM
__destruct and outputting views - by El Forum - 01-15-2009, 10:46 AM
__destruct and outputting views - by El Forum - 01-15-2009, 10:05 PM
__destruct and outputting views - by El Forum - 01-16-2009, 12:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB