[eluser]mortifrog[/eluser]
ok one last quick reply then off to the land of nod.
Quote:Every Controller is also available over the url
- yes but you can make all of it's functions private by prefixing them with a double underscore can you not?
I can envisage wanting to borrow the logic of one controller within another - but I take on board what your saying about hooks and helpers and stuff. I've not really got that far yet.
I did try this though:
Code:
class Quatermass extends Controller {
function Quatermass()
{
parent::Controller();
}
function index()
{
include('./system/application/controllers/quatermass2.php');
$q2= new Quatermass2;
$data['site_name'] = 'Quatermass';
$data['template'] = 'default';
$data['content'] = $this->load->view('view_a');
$data['content'] .= $this->load->view('view_b');
$data['content'] .= $q2->wow();
$this->load->view('templates/default/index', $data);
}
}
/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
?>
Code:
<?php
class Quatermass2 extends Controller {
function Quatermass2()
{
parent::Controller();
}
function wow()
{
$wow = 'Wow!';
return $wow;
}
}
?>
And it worked, which is pretty useful to know as long as it's not a bad habit to get into.
Don't know why the output returns Wow on a new line though. Goodnight all.