On Fri, Oct 22, 2010 at 9:00 AM, Adrian Arnautu
<[email protected]> wrote:
> Hello,
> I'm facing a strange problem. In my controller I call $this->render() with a
> particular layout and then I use the default layout.
> Example:
> $this->set('foo', $this->render('bar', 'other_layout');
> $this->layout = 'default';
> I know it's wrong and it's not the MVC way, the rendering part should reside
> in the View, but why is this happening?
> The $this->layout = 'default' does not solve the problem. And I do not
> disable autoRender.

You might try setting $this->output to null after rendering 'bar' and
setting 'foo'. Then be sure to call render() again at the end of the
action. That's what I did in my SwiftMailerComponent, to render both
plaintext and html views.

You're also missing the closing brace for set() but that's probably
not straight from your code.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to