Easiest way is to use content capturing:

    <?  $this->dojo()->accordionContainer()->captureStart('identifier', $params, $attribs) ?>
    <?= $this->dojo()->contentPane('paneIdentifier2', $content, $params, $attribs) ?>
    <?= $this->dojo()->contentPane('paneIdentifier2', $content, $params, $attribs) ?>
    <?= $this->dojo()->accordionContainer()->captureEnd('identifier') ?>

$params and $attribs are always optional; $params are Dijit parameters,
$attribs are HTML attributes.

The captureStart/captureEnd pairs can also be used with the contentPanes
themselves, using the same syntax as for the container.
  

Nearly there. I don't like using the <?= syntax so I have:

print $this->accordionContainer()->captureStart(
    'accordion1',
    array('title' => 'Pane Title'),
    array('style' => 'background-color: lightgray;'));
print $this->accordionPane(
    'p1',
    'Pane 1 Content',
    array('title' => 'Pane 1 Title'),
    array('style' => 'background-color: lightgray;'));
print $this->accordionPane(
    'p2',
    'Pane 2 Content',
    array('title' => 'Pane 2 Title'),
    array('style' => 'background-color: lightgray;'));
print $this->accordionContainer()->captureEnd('accordion1');


Now according to your sample I should omit the "print" for the first $this->accordionContainer() BUT if I leave it out it does not work. Problem is if I leave it in in inserts an extra "1" inside the accordion div.


Reply via email to