innerContent and view.php

Permalink 1 user found helpful
I don't want to duplicate templates so much, so I tend to use $this->inc() like this:

//default.php
$this->inc('view.php');
//view.php
$this->inc('left_sidebar.php');
//left_sidebar.php
<the actual template>
echo $innerContent


Problem is, $innerContent is empty when I try to access a login page for example. If I copy the content from left_sidebar.php to view.php, it does work.

Question is, how do I pass the $innerContent to left_sidebar?

A3020
 
A3020 replied on at Permalink Reply
A3020
Ok, I came with a workaround. I don't know whether it's the best solution, but it works :)

//view.php
$this->controller->set('innerContent', $innerContent);
$this->inc('left_sidebar.php');


//left_sidebar.php
echo $this->controller->get('innerContent');