Zend framework ZendX日期选择器示例不工作
我是ZendX的新手,我真的很想让Zend上的简单JQuery示例开始工作。我已经在下面的链接中使用了这个示例,但我得到的只是一个没有任何日期选择器功能的普通文本框,正如我所期望的那样 在我的引导程序中,我有Zend framework ZendX日期选择器示例不工作,zend-framework,jquery-ui,zendx,Zend Framework,Jquery Ui,Zendx,我是ZendX的新手,我真的很想让Zend上的简单JQuery示例开始工作。我已经在下面的链接中使用了这个示例,但我得到的只是一个没有任何日期选择器功能的普通文本框,正如我所期望的那样 在我的引导程序中,我有 protected function _initViewHelpers() { $this->bootstrap('layout'); $layout = $this->getResource('layout');
protected 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('JQUERY Test');
//assuming you already have this function in your bootstrap
//jQuery (using the ui-lightness theme)
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$view->jQuery()->addStylesheet('/js/jquery/css/ui-lightness/jquery-ui-1.7.2.custom.css')
->setLocalPath('/js/jquery/js/jquery-1.3.2.min.js')
->setUiLocalPath('/js/jquery/js/jquery-ui-1.7.2.custom.min.js');
}
在我的布局中,我包括了
<head>
<?php echo $this->HeadMeta(); ?>
<?php echo $this->headTitle(); ?>
<?php echo $this->headLink(); ?>
<?php echo $this->headScript(); ?>
<?php echo $this->jQuery(); ?>
<?php echo $this->headLink()->prependStylesheet($this->baseUrl().'/css/main.css'); ?>
<?php echo $this->render('_javascript.phtml'); ?>
</head>
我错过了什么
您添加了
ZendX\u JQuery::enableView($view)代码>到_initviewshelpers我通过application.ini的方式,其工作原理如下:
resources.view.helperPath.ZendX_JQuery_View_Helper = "ZendX/JQuery/View/Helper"
resources.view[] =
pluginPaths.ZendX_Application_Resource = "ZendX/Application/Resource"
resources.jquery.localpath = "/project1/public/jquery/development-bundle/jquery-1.7.1.js"
resources.jquery.stylesheet = "/project1/public/jquery/development-bundle/themes/smoothness/jquery-ui-1.8.18.custom.css"
resources.jquery.uilocalpath = "/project1/public/jquery/development-bundle/ui/jquery-ui-1.8.18.custom.js"
我不确定引导代码,但我从研究中得到的是下面的代码。也许最后三行会有帮助
protected 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('JQUERY Test');
//assuming you already have this function in your bootstrap
//jQuery (using the ui-lightness theme)
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$view->jQuery()->addStylesheet('/js/jquery/css/ui-lightness/jquery-ui-1.7.2.custom.css')
->setLocalPath('/js/jquery/js/jquery-1.3.2.min.js')
->setUiLocalPath('/js/jquery/js/jquery-ui-1.7.2.custom.min.js');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
}
这是我用来做我的例子的解决方案,但没有用。很抱歉,我忘了在前面指定那个链接。至于本地文件,我已经交叉检查过了,路径是正确的。