How do you integrate an accordian widget into a helloworld zend project? This is what I have so far and all I get is the page with the messages no accordians.
Bootstrap:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initView()
{
$view = new Zend_View();
//$view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
开发者_开发知识库 $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
$view->addHelperPath('Zend/Dojo/View/Helper/','Zend_Dojo_View_Helper');
$view->dojo()->addStylesheetModule('dijit.themes.tundra');
}
}
Layout File:
<?php echo $this->doctype() ?>
<html>
<head>
<?php echo $this->headTitle() ?>
<?php echo $this->headMeta() ?>
<?php echo $this->headLink() ?>
<?php echo $this->headStyle() ?>
<?php if ($this->dojo()->isEnabled()){
$this->dojo()->setLocalPath('/js/dojo/dojo.js')
->addStyleSheetModule('dijit.themes.tundra');
echo $this->dojo();
}
?>
<?php echo $this->headScript() ?>
</head>
<body class="tundra">
<?php echo $this->layout()->content ?>
<?php echo $this->inlineScript() ?>
</body>
</html>
View:
<?php // setup required dojo elements:
$this->dojo()->enable()
->setDjConfigOption('parseOnLoad', true)
->requireModule("dijit.layout.AccordianContainer")
->requireModule("dijit.layout.ContentPane")?>
<div style="width: 300px; height: 300px">
<div dojoType="dijit.layout.AccordionContainer" style="height: 300px;">
<div dojoType="dijit.layout.ContentPane" title="Heeh, this is a content pane">
Hi!
</div>
<div dojoType="dijit.layout.ContentPane" title="This is as well" selected="true">
Hi how are you?
</div>
<div dojoType="dijit.layout.ContentPane" title="This too">
Hi how are you? .....Great, thx
</div>
</div>
</div>
精彩评论