-- Ari Awan <[email protected]> wrote
(on Monday, 30 March 2009, 11:44 AM +0900):
> I have a question, why does this snippet $this->dojo()->isEnabled()  
> always returns 'true' ?
>
> I put it in my layout script in the html head part. And I dont set  
> $this->dojo()->enable() in any of my project.
>
> Furthermore I tried put $this->dojo()->disable() in my view script but it 
> didnt change anything.

I've done the following, just to test:

    $view = new Zend_View();
    Zend_Dojo::enableView($view);
    $view->dojo()->disable();
    echo "enabled? " . var_export($view->dojo()->isEnabled(), 1) . "\n";
    $view->dojo()->enable();
    echo "enabled? " . var_export($view->dojo()->isEnabled(), 1) . "\n";

and get the expected output:

    enabled? false
    enabled? true

Now, that said, rendering a dijit will always implicitly enable the
helper. It's possible that by the time you get to the layout script,
you've done so, and this is why it's enabled.

> my view scripts are all part of contents, so it will always be render  
> after the html head part in my layout script ($this->layout()->content )
>
> Is there a way to enable/disable dojo() from the controller?

-- 
Matthew Weier O'Phinney
Software Architect      | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to