2009年4月20日星期一

[fw-mvc] Problems with dojo in partials

Hi,

I creted a zend framework project with a layout.

My layout looks like this:

<html>
<head>
<?php
$config = Zend_Registry::get('config');
$baseUrl = Utils::getBaseUrl();

echo $this->headTitle('Title');
echo $this->headScript();
echo $this->headStyle();
echo $this->headLink()
->appendStylesheet($baseUrl . '/styles/main.css')
->appendStylesheet($baseUrl . '/styles/listMenu.css')
->appendStylesheet($baseUrl . '/styles/dropDownMenu.css')
->appendStylesheet($baseUrl . '/styles/main/style.css')
->appendStylesheet($baseUrl . '/styles/main/iefix.css', 'screen,
projection', 'lt IE 7')
;

if ($this->dojo()->isEnabled()) {
$this->dojo()
->setLocalPath($baseUrl . '/scripts/dojo/dojo/dojo.js')
->addStyleSheetModule('dijit.themes.' .
$config->options->dojo->style)
/*->requireModule('dijit.Dialog')
->requireModule('dojo.parser')
->requireModule('dijit.layout.BorderContainer')
->requireModule('dijit.layout.ContentPane')
->requireModule('dojo.fx')
->requireModule('dojo.data.ItemFileReadStore')
->requireModule('dojox.data.QueryReadStore')*/
->setDjConfig(array('parseOnLoad' => true))
;
echo $this->dojo();
}
?>
</head>
<body class="<?=$config->options->dojo->style?>">
<!-- some HTML... -->
&lt;?php
echo $this-&gt;partial('header');
//or echo $this-&gt;render('header');
?&gt;
<!-- some HTML... -->
&lt;?php
echo $this-&gt;layout()-&gt;content;
?&gt;
&lt;/body&gt;


Dojo is working fine in the layout content, but the dojo elements from the
partial (header.phtml) don't work. I think this is because the partial is
called after the $this->dojo() has been issued. But how can I fix this
problem?
--
View this message in context: http://www.nabble.com/Problems-with-dojo-in-partials-tp23150088p23150088.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: