Hi Martin

>What is still not clear to me though is how they relate to each other.

ZVE proposes a variety of helpers to facilitate some nifty dynamic View 
construction using partial templates, controller calls, and place holders. 
Zend_Layout will provide a high-level layout system. So both at present are 
complementary. In case its confusing - ZVE had a Layout component, but it will 
not be implemented in Zf Core (Zend_Layout enters here ;)).

>Are they providing complementary functionnality to a (global) solution for 
>layouts and templates ?

>If so, how would they work together in an application ?

Yes. ZVE is primarily template driven - so it operates at a lower level on any 
templates which are aggregated at the higher level represented as a Layout 
(Zend_Layout). A lot of it is just making reusable views more easily written 
and wired together.

Regards,
Martin




On 9/20/07, Pádraic Brady <
[EMAIL PROTECTED]> wrote:
Hi Ralf,

>The MVC component determines (somehow), based on the route, which view
>script is supposed to be rendered. This view script will have such a
>structure which renders a valid HTML document:


The MVC component utilises an optional (enabled by default) plugin called 
Zend_Controller_Action_Helper_ViewRenderer which insitutes a convention of 
mapping Module/Controller/Action names to a relevent view script name. So 
IndexController::saveAction() will automatically render the view script at

{viewBasePath}/index/save.phtml.

You can modify the convention by altering a few settings on the ViewRenderer 
(covered at least once in the past day on the mailing lists ;)). Or even 
disable the automated rendering if you prefer.


>I'd like to have it vice versa,
 where the layout is a full HTML document
>which renders the related view script. So I managed my application to
>work with this "layout" view script:

Indeed, there have been proposals for achieving this hanging around from months 
addressing the concept of common "Layouts". This was captured in two proposals 
- Zend_View Enhanced and Zend_Layout. The Zend_Layout methodology has been 
decided to be used in ZF 
1.1 so I can point you to the soon-to-be-official approach offered by Ralph 
Schindler.

Unfortunately the ZF Wiki cannot be referred to since it is perfectly useless 
to anyone in GMT and is presently offline as usual. But there's a good blog 
post containing all the details and a brief tutorial of usage:

http://www.spotsec.com/blogs/archive/the-basics-of-zend_layout-ahem-xend_layout.html


In
 combination with Zend_Layout, pretty much all of the remaining Zend_View 
Enhanced (excepting its Layout solution) is also to be implemented in ZF 1.1. 
This adds concepts such as Partials, Components (controller calls), 
Placeholders (capture data from view scripts for inclusion in a Layout/Other 
View), and some other stuff.


In combination, both ZL and ZVE should be sufficient to resolve most of the 
problems people currently have with Zend_View.

Regards,
Paddy

 

Pádraic Brady


http://blog.astrumfutura.com
http://www.patternsforphp.com

OpenID Europe Foundation Member-Subscriber



----- Original Message ----
From: Ralf Kramer <[EMAIL PROTECTED]>
To: 
[email protected]
Sent: Thursday, September 20, 2007 12:30:46 AM
Subject: [fw-general] Using a complete HTML Template

Hi,

as I understood the common process of template rendering it works in

this manner:

The MVC component determines (somehow), based on the route, which view
script is supposed to be rendered. This view script will have such a
structure which renders a valid HTML document:


<?php echo
 $this->render('layouts/__header.phtml'); ?>
<p>some stuff <?= $this->fromView ?> </p>
<?php echo $this->render('layouts/__footer.phtml'); ?>


I'd like to have it vice versa, where the layout is a full HTML document

which renders the related view script. So I managed my application to
work with this "layout" view script:

<html>
<head></head>
<body>
<h1>header stuff</h1>

<?= $this->render( $this->viewScript ) ?></td>
<h1>footer stuff</h1>    
</body>
</html>

In my controller I do this on postDispatch()
public function postDispatch()

{
$this->view->viewScript = $this->getRequest()->getControllerName() 
                        .
 "/" . $this->getRequest()->getActionName() 
                        . ".phtml";
$this->_helper->viewRenderer->renderScript("layouts/main.phtml" );
}


It works, but it is not flexible cause _forward() renders the layout

view script a second time. Invocation on preDispatch() or smth. else
dont works, cause there are no assigned data available in the view
scripts. Now I believe my approach is a dead-end street...any help is
appreciated ;-)


Best regards
 /Ralf










      Looking for a deal? 
Find great prices on flights and hotels with Yahoo! FareChase.




-- 
Martin Carpentier






       
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for 
today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

Reply via email to