Conversely, simply move your head tags, etc, into a layout (it looks as if they're in your view script from your snippets). The layout is rendered after the views, so everything should fire in the correct order.

Matthew Weier O'Phinney wrote:
-- Superbiji » <[EMAIL PROTECTED]> wrote
(on Wednesday, 26 November 2008, 04:21 PM +0700):
Hi All..
i've been trying zf 1.7 and add accordionContainer but without
success..... please can anyone give me full examples? can't find it in
manual yet.

in my action:
        function dojoformAction() {
                Zend_Dojo::enableView($this->view);
                
        }

view:

<?= $this->dojo()->enable();  ?>

</head>
<body class=tundra>


<?= $this->accordionContainer(
    'foo',
    $content . "XXXXXXXXXX",
    array(
        'duration' => 200,
    ),
    array(
        'style' => 'width: 200px; height: 300px;',
    ) );
?>

This is a classic mistake -- you're rendering the dojo() view helper
*before* any methods that would populate it have been called.

The easy solution is to capture the content of your accordionContainer()
call *prior* to doing so, and then echo that content; I've done
similarly in the pastebin example application, only I do so by rendering
another view script.

As an example, modify your layout script as follows:

    <? $container = $this->render('bodyAccordion.phtml'); ?>
    <?= $this->doctype() ?>
    <html>
    <head>
        ...
        <?= $this->dojo() ?>
    </head>
    <body class="tundra">
        <?= $container ?>
    </body>
    </html?

and then, in bodyAccordion.phtml:

<? $this->dojo()->enable();
    echo $this->accordionContainer(....);


Reply via email to