我正在尝试测试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
另外,在bootstrap文件中,我必须删除以下行:
$view->baseUrl = Zend_Registry::get('config')->root_path;否则我会得到这个错误-> http://pastebin.com/tde4J7L1
谢谢
发布于 2012-05-02 23:16:53
将此方法添加到_initView方法之上
public function _initSetup()
{
Zend_Registry::set('config', new Zend_Config($this->getOptions()));
}在你的application.ini中添加下面这一行
phpSettings.date.timezone = "Europe/London"如果您正在使用布局,则在layout.phtml中执行此操作,否则将其粘贴到日期选择器的上方
<?php echo $this->jQuery(); ?>https://stackoverflow.com/questions/10415339
复制相似问题