2009年4月20日星期一

Re: [fw-mvc] Problems with dojo in partials

Hey,

That's because your doing this all wrong. Please refer to the quick start guide in the zend framework manual on understanding how to create the application structure.

Vince.

On Tue, Apr 21, 2009 at 9:45 AM, Matthias W. <Matthias.Wangler@e-projecta.com> wrote:

Hi,

I creted a zend framework project with a layout.

My layout looks like this:

&lt;html&gt;
&lt;head&gt;
&lt;?php
$config = Zend_Registry::get('config');
$baseUrl = Utils::getBaseUrl();

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

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




--
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.




没有评论: