Hi there,
I'm creating a user module and I have controller "user.php" which has the following function:
_____________________________________________________________
function register() {
$data['foo'] = 'bar';
$this->load->view('register', $data);
}
_____________________________________________________________
Then I have the register.php in /views/ which is:
_____________________________________________________________
<?php
fuel_set_var('layout', 'main');
?>
Register Now:
_____________________________________________________________
Lastly I have main.php in /views/_layouts/:
_____________________________________________________________
<?php $this->load->view('_blocks/header')?>
<?php echo fuel_var('body', ''); ?>
<?php $this->load->view('_blocks/footer')?>
_____________________________________________________________
Register.php loads, however my layout never does, what am I doing wrong/overlooking?
Comments
$this->fuel->pages->render('register', $data);
More on using a controller to display your page content from the CMS can be found here:
http://docs.getfuelcms.com/general/pages-variables#controller
Just to clarify the view is a static php file thats just trying to load the layout.
$this->fuel->pages->render('register', $data, array('render_mode' => 'views'));