zendframework/ZendSkeletonApplication — Issue #16: Layout
Author: geckoeffect
Created: 2012-01-10 22:14:08+00:00
State: open

Hi,

I'm rather new to using ZF2 and Skeleton App, please forgive me if I am
1) Out of place/location or
2) Incorrect with my issue...

I've just experienced a issue with trying to change layouts both within the Controller using
$this->_helper->_layout->setLayout('altlayout');
And the view using
$this->layout()->setLayout('altlayout');

I have copied the layout.phtml and made one major cosmetic change for texsting

trying within the control it complains errors
PHP Notice: Undefined property: Test\Controller\TestController::$_helper
and
PHP Fatal error: Call to a member function setLayout() on a non-object

and the view stays with the default layout.
even though
doing an echo $this->layout()->getLayout(); before and after the setLayout shows the change.

I can't 100% say I haven't done something incorrect and it is a bug, however by all accounts and researching I feel I've done everything correctly and things are not responding as expected... particularly the $this->layout()->setLayout('altlayout');

Can someone please confirm this is a bug, then I'll stop going round in circles and pulling code apart :)

Thanks in advance,
T