[eluser]Adam Griffiths[/eluser]
I think my code will explain this a bit better...
Code:
<?php
class Pages extends Controller
{
function __construct()
{
parent::Controller();
}
function index()
{
if($this->uri->segment(1) == NULL)
{
$this->load->view('header');
$this->load->view('home');
$this->load->view('footer');
}
else
{
$page = $this->uri->segment(2);
$this->load->view('header');
$this->load->view('$page'); // here is the problem
$this->load->view('footer');
}
}
}
There's my controller...the problem is commented.
I get this error...
Quote:An Error Was Encountered
Unable to load the requested file: $page.php
Is there any way I can do this? I've tried many times with different quote marks etc, but nothing has worked so far.
Thanks.