2008年12月1日星期一

[fw-mvc] Zend Dojo don't work

Hi

Have used this code for enable the dojo view helper in my own plugin(use
Zend Layout):


$view=$layout->getView();
Zend_Dojo::enableview($view);
$view->dojo()->addStylesheetModule('dijit.themes.tundra')
->setLocalPath('/lib/dojo/dojo/dojo.js');

and have insert this code in my view template file:

<?= $this->doctype() ?>
<html>
<head>
<? $this->dojo()->enable;?>
<?= $this->dojo();?>
</head>

<body class="tundra">


<?
$this->borderContainer()->captureStart('masterLayout',
array('design' => 'headline'));
echo $this->contentPane(
'menuPane',
'This is the menu pane',
array('region' => 'top','parseOnLoad'=>true)
);
echo $this->contentPane(
'navPane',
'This is the navigation pane',
array('region' => 'left','parseOnLoad'=>true)
);
echo $this->contentPane(
'mainPane',
'This is the main content pane area',
array('region' => 'center','parseOnLoad'=>true)
);
echo $this->contentPane(
'statusPane',
'Status area',
array('region' => 'bottom','parseOnLoad'=>true)
);
echo $this->borderContainer()->captureEnd('masterLayout');
?>

</body>

</html>

now this code print all the Dojo code but don't work.... (have a white
page):this is the the output from firefox:
(note: the css and js url's are exact)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<style type="text/css">
<!--
@import "/lib/dojo/dijit/themes/tundra/tundra.css";
-->
</style>

<script type="text/javascript" src="/lib/dojo/dojo/dojo.js"></script>

<script type="text/javascript">
//<!--
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.BorderContainer");
dojo.require("dojo.parser");
dojo.addOnLoad(function() {
dojo.forEach(zendDijits, function(info) {
var n = dojo.byId(info.id);
if (null != n) {
dojo.attr(n, dojo.mixin({ id: info.id }, info.params));
}
});
dojo.parser.parse();
});
var zendDijits =
[{"id":"menuPane","params":{"region":"top","parseOnLoad":"true","dojoType":"dijit.layout.ContentPane"}},{"id":"navPane","params":{"region":"left","parseOnLoad":"true","dojoType":"dijit.layout.ContentPane"}},{"id":"mainPane","params":{"region":"center","parseOnLoad":"true","dojoType":"dijit.layout.ContentPane"}},{"id":"statusPane","params":{"region":"bottom","parseOnLoad":"true","dojoType":"dijit.layout.ContentPane"}},{"id":"masterLayout","params":{"design":"headline","dojoType":"dijit.layout.BorderContainer"}}];
//-->

</script></head>

<body class="tundra">

<div id="masterLayout"><div id="menuPane">This is the menu pane</div>
<div id="navPane">This is the navigation pane</div>

<div id="mainPane">This is the main content pane area</div>
<div id="statusPane">Status area</div>
</div>
</body>

</html>


--
View this message in context: http://www.nabble.com/Zend-Dojo-don%27t-work-tp20787446p20787446.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: