Hi Ralph,

glad to be of assistance. Right now I'm running my main layout with 9 sub-requests without any noticeable performance impact.

Only thing is when an error occurs and the ErrorHandler controller plugin dispatches to the error controller, the layout get's rendered twice (once normal and once inside the content property of the view) and all sub-requests are lost. But I'll look into this if I find some time next week, after fixing all the "Hey, there's a new ZF Version, let's overwrite the old library"-Bugs ;-D

Have a nice weekend,
Sascha

Ralph Schindler schrieb:
Sascha,
Thanks for the bug report, I have fixed it and committed the fix as well as some changes to the class. I have updated both the working version Xend_Layout, and the for proposal version Zend_Layout.

Kevin McArthur will have tutorials ready pretty soon, but it sounds like you're well ahead of needing those!

Again.. Thanks,
Ralph

Working:
http://svn.ralphschindler.com/repo/Xend/

Proposed Layout (synced with above)
http://svn.ralphschindler.com/repo/ZendFramework/Zend_Layout/

Interesting helpers:
http://svn.ralphschindler.com/repo/ZendFramework/Zend_View-AdditionalHelpers/


Sascha Goebel wrote:
Hi Ralph,

I've been fiddling around with your layout class for the last days and
always asked myself why I had to set the response segment name myself
when using the addRequest method. A little digging into the sources
today gave the answer :-)

In LayoutProcessor.php line 161 the code reads

$this->_layoutManager->setResponseSegmentName($current_request_name);

this should be

$this->_layoutManager->setResponseSegmentName($current_request->getName());

and everything works just fine.

Thanks a lot for your great work on this!

Oh, and for everyone asking what I'm talking about or wanting a small
example, here's what I do to use layout with subparts (say additional
rendered actions):

bootstrap.php
================
// Do this directly before calling dispatch()
Xend_Layout::setup(array('path' => PATH_APPLICATION . 'common' .
DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR));
Xend_Layout::setDefaultLayoutName('base');

ControllerClass where the subpart is needed (best would be to do this
via an extended action controller)
=================================
$this->getHelper('LayoutManager')->getLayout('base')->addRequest(new
Xend_Layout_Request('LoginBox', 'loginbox', 'auth'));

base.phtml (layout)
=======================
<div id="sidebar-left">
<p class="skip-link"><a href="#content"><?php echo $this->_('Skip to
main content'); ?></a></p>
<?php echo $this->LoginBox; ?>
</div>

<div id="content">
<a name="content"></a>
<?php echo $this->content; ?>
</div>

That's it :-)

Thanks again and read you later,
Sascha



Reply via email to