我正在尝试测试 jQuery 是否在我的应用程序中工作我的引导程序中有以下内容:
引导程序:
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initView()
{
$view = new Zend_View();
$view->doctype('XHTML1_STRICT');
$view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
$view->headTitle()->setSeparator(' - ');
$view->headTitle('IMR - BI System');
$view->env = APPLICATION_ENV;
$view->baseUrl = Zend_Registry::get('config')->root_path;
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$view->jQuery()->addStylesheet($view->baseUrl . '/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css');
$view->jQuery()->setLocalPath($view->baseUrl . '/js/jquery/js/jquery-1.7.2.min.js');
$view->jQuery()->setUiLocalPath($view->baseUrl .'/js/jquery/js/jquery-ui-1.8.20.custom.min.js');
$view->jQuery()->enable();
$view->jQuery()->uiEnable();
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
return $view;
}
}
然后在我看来:
<?php echo $this->datePicker("dp1", '', array('defaultDate' => date('Y/m/d', time()))); ?>
我得到了文本框,但出现以下错误-> http://pastebin.com/7Hv7d2Qf
同样在引导文件中,我必须删除以下行:
$view->baseUrl = Zend_Registry::get('config')->root_path;
否则我得到这个错误-> http://pastebin.com/tde4J7L1
谢谢