[Solar-talk] Seperating logic and layout in layouts

Rodrigo Moraes rodrigo.moraes at gmail.com
Mon May 12 07:44:34 CDT 2008


On Wed, May 7, 2008 at 8:09 PM, Richard Thomas wrote:
>  Now I have a <?php echo $this->login_box; ?>
>
>  And in my controller I have a $this->login_box = $this->fetch('logged_out')
>
>  No errors, web server segment faults on me...
>
>  Any ideas..

Controller's fetch() is not the same as view's fetch(). You'd need
something like:

$this->login_box = $this->_view->fetch('logged_out');

The problem is that the $_view object is not normally available during
an action (it will only be created during the controller's fetch()
process). So you need to create it earlier, *or* create a new view
object, it depends on your needs. I personally force the creation of
view on demand, using a _getViewObject() called on __get() whenever
$_view is requested.

hope this helps.

rodrigo moraes


More information about the Solar-talk mailing list