-- jigen7 <[email protected]> wrote
(on Thursday, 09 July 2009, 08:49 PM -0700):
> im really really confuse about the bootstrap, iim following this tutorial on
> how to enable dojo with zend as i want to learn dojo,
> http://zendgeek.blogspot.com/2009/07/creating-nice-dojo-form-in-zend.html
> but the 1st step is to enable the dojo in bootstrap which has this code 
> 
> //$view = new Zend_View(); 
> $view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); 
> $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); 
> $viewRenderer->setView($view); 
> Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
> 
> but when i look at my bootstrap....
> ///////
> <?php
> 
> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
> {
> protected function _initAutoload()
>     {
>         $moduleLoader = new Zend_Application_Module_Autoloader(array(
>             'namespace' => '', 
>             'basePath'  => APPLICATION_PATH));
>         return $moduleLoader;
>     }
>     
>      function _initViewHelpers()
>     {
>         $this->bootstrap('layout');
>         $layout = $this->getResource('layout');
>         $view = $layout->getView();
> 
>       $view->doctype('XHTML1_STRICT');
>         $view->headMeta()->appendHttpEquiv('Content-Type',
> 'text/html;charset=utf-8');
>         $view->headTitle()->setSeparator(' - ');
>         $view->headTitle('Credit Scoring System');
>     }
>     }
> 
> where should i put the code??my bootstrap file is in the application folder

You're already on the right track. All you need to do is add the
following line to your _initViewHelpers() method:

    Zend_Dojo::enableView($view);

And then, if you need to further configure the dojo() view helper, do it
in the same method:

    $view->dojo()->setLocalPath('/js/dojo/dojo.js')
                 ->requireModule('dojo.data.ItemFileReadStore');
    // etc....

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

Reply via email to