Tag: zend framework

如何获取访问我网站的用户的当前时间/时区?

我正在开发一个使用PHP(Zend Framework)和JavaScript(jQuery)的应用程序。 我正在尝试获取用户访问该网站的当前时间。 这可能吗? 如何才能做到这一点?

在Zend Framework项目中设置jQueryUiPath

在我的主布局模板中,我设置了jQuery路径: if ($this->jQuery ()->isEnabled ()) { $this->jQuery ()->setLocalPath ( $this->baseUrl () . ‘/js/jquery/jquery-1.4.2.min.js’ )->setUiLocalPath ( $this->baseUrl () . ‘/js/jquery/jquery-ui-1.8.4.custom.min.js’ )->addStyleSheet ( $this->baseUrl () . ‘/js/jquery/css/custom-theme/jquery-ui-1.8.4.custom.css’ ); echo $this->jQuery (); } 但由于某种原因,ui javascript文件没有出现在标题中,但是包含了ui的css。 有任何想法吗?

如何在Layouts中启用ZendX集成Jquery

我试图理解为什么ZendX_JQuery在布局中直接使用时不起作用。 在视图中它完美正常: 创建所需的代码 将JQuery脚本放在head标签中 但是在布局中使用时 创建所需的代码 不会在head标记中插入JQuery脚本 这可以克服,怎么样? 而且,如果有人能回答这个问题,为什么要这样做呢? 为了使它清楚,这是我想要做的: //layout.phtml file jQuery();?> ajaxLink(“Like”, “/mod/instr/like/id/”.$this->books[‘id’], array(‘update’ => ‘#ajaxed’, ‘beforeSend’=>’fadeout’ )); ?> layout()->content; ?> </body 这意味着,我希望在布局中放置一个jQuery对象。 我想在我的布局文件中直接放置一些与jQuery相关的代码,而不仅仅是允许jQuery为需要它的视图初始化的部分。 编辑:好的,所以这里是Bootstrap中的init函数 protected function _initJqueryLoad() { $view = new Zend_View(); // $view->addHelperPath(‘ZendX/JQuery/View/Helper/’, ‘ZendX_JQuery_View_Helper’); $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/jquery.js’) ->setUiLocalPath(‘/js/jquery/js/jquery-ui-1.7.2.custom.min.js’); ZendX_JQuery::enableView($view); } 我的布局文件包含在头部: headLink()->prependStylesheet($this->baseUrl().’/css/admin.css’); ?> headLink()->prependStylesheet($this->baseUrl().’/css/form.css’); ?> headScript()->prependFile(‘/js/JP.js’,’text/javascript’,”);?> jQuery(); ?> 因此,应该在使用此布局的每个视图中启用JQuery。 在我的视图中运行但在我的布局中运行的代码是: […]

如何在另一个字段lostfocus之后用数据库信息填充文本框

你能帮我找到解决问题的方法吗? 我有4个文本框字段: number , key , firstname和name 。 当我填写后从数字字段列表,我想检查我的数据库是否存在这个数字。 如果是这样,我的应用程序应该选择链接到该号码的名称和名字(在我的数据库中)并填写其他字段名称和名字,然后禁用这些字段。 我认为我应该使用ajax但我不知道如何使用ajax和Zend来实现它。 我搜索了网页,发现了一些我不理解的教程。 请你能一步一步地给我这样做吗? 谢谢

JQuery Ajax失败并返回exception?

我已经阅读了一些关于JQuery Ajax调用的失败参数的post,但没有一个直接回答了我的问题。 如果你想在这里阅读我的跳跃点,这篇文章将是一个良好的开端: jquery:Jquery中有$ .post的失败处理程序吗? 我的问题是有一些东西可能导致我的应用程序失败 – 如果我的脚本返回false,上面的方法对我来说就好了(如果我理解正确的话),但大多数时候我的脚本会失败踢出我使用Zend Framework处理的exception。 我宁愿返回exception,以便我可以向用户提供更详细的消息。 是否有可能让我的PHP脚本返回一个值,同时仍然让Ajax调用知道它是一个失败?

Zend Framework – JQuery – 日期选择器 – 图像未显示

我正在使用Zend Framework开发一个Web应用程序,我正在为表单使用JQuery。 我在表单中遇到DatePicker的问题。 当我单击文本输入时,会出现DatePicker,但没有主题图像… 在我的引导程序中: $view->addHelperPath(‘ZendX/JQuery/View/Helper/’, ‘ZendX_JQuery_View_Helper’); $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); $viewRenderer->setView($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); 在我的application / layout / scripts / layout.phtml中: headLink()->appendStylesheet(‘http://localhost:10089/css/global.css’) ?> jQuery()->setLocalPath(‘http://localhost:10089/js/jquery/jquery-1.3.2.js’) ->addStylesheet(‘http://localhost:10089/js/jquery/themes/base/ui.datepicker.css’); echo $this->jQuery(); ?> 我想这不过是一个路径问题,但是我不知道这里有什么问题…我看了一下ui.datepicker.css,并且没有指向images文件夹的链接,但是当我运行随附的演示时JQuery,datepicker与其图像一起显示…… 请帮我!

如何在一个jQuery UI选项卡中使用jQuery UI选项卡?

我正在使用jQuery UI选项卡(通过AJAX的内容)我需要做的是在我的一个选项卡中我希望其他简单的jQuery UI选项卡意味着(内容不通过AJAX)但它不起作用..请原谅,如果我做错了什么:( //these tabs are working fine <a href="https://stackoverflow.com/questions/15251524/how-to-use-jquery-ui-tabs-inside-one-jquery-ui-tab/url(array(), ‘abc’) ?>”>A <a href="https://stackoverflow.com/questions/15251524/how-to-use-jquery-ui-tabs-inside-one-jquery-ui-tab/url(array(), ‘asd’) ?>”>B <a href="https://stackoverflow.com/questions/15251524/how-to-use-jquery-ui-tabs-inside-one-jquery-ui-tab/url(array(), ‘xyz’) ?>”>C 我在xyz控制器的视图中添加了以下代码,但它无法正常工作 $(function() { $( “#tabss” ).tabs(); }); Nunc tincidunt Proin dolor Aenean lacinia abcd……. xyz……. abcd……. content……. 我已经包括了所有这些

如何在确认弹出窗口中使用zend delete动作?

我想使用确认弹出窗口删除我的项目,所以这是我的删除操作: public function deleteAction() { $id = (int) $this->params()->fromRoute(‘id’, 0); $article = $this->getObjectManager()->find(‘\Application\Entity\Article’, $id); if ($this->zfcUserAuthentication()->hasIdentity()) { if ($this->request->isPost()) { $this->getObjectManager()->remove($article); $this->getObjectManager()->flush(); return $this->redirect()->toRoute(‘blog’); } } else { return $this->redirect()->toRoute(‘user’); } return new ViewModel(array(‘article’ => $article)); } 这是我的博客视图,我有删除链接: <a href="https://stackoverflow.com/questions/21991035/how-to-use-zend-delete-action-in-confirmation-popup/url(‘delete’, array(‘action’=>’delete’, ‘id’ => $articles->getId())) ?>” class=”btn btn-default btn-lg” onclick=”if (confirm(‘Are you sure?’)) { document.location = […]

ZendX_JQuery还是Zend_Dojo?

在Zend_Framework中有ZendX_JQuery和Zend_Dojo 。 如果我对JQuery或Dojo知之甚少,我不知道哪个更好,哪个更容易使用? 我可以花时间学习JQuery或Dojo,但我不知道哪一个是Zend Framework的更好选择以及为什么。 谢谢

SSL CORS与Zend Guard不兼容

我已经将所有内容添加到我的Apache htaccess中: 头设置Access-Control-Allow-Headers:X-Requested-With Header set Access-Control-Allow-Methods:OPTIONS Header add Access-Control-Allow-Methods:GET Header add Access-Control-Allow-Methods:POST Header add Access-Control-Allow-Headers:Content-Type Header添加Access-Control-Allow-Headers:Depth Header添加Access-Control-Allow-Headers:User-Agent Header添加Access-Control-Allow-Headers:X-File-Size标题添加Access-Control-Allow-Headers:X-Requested-With Header添加Access-Control-Allow-Headers:If-Modified-Since Header添加Access-Control-Allow-Headers:X-File-Name Header添加Access-Control -Allow-Headers:Cache-Control Header set Access-Control-Allow-Origin:http://mysite.com Header add Access-Control-Allow-Origin:https://mysite.com Header set Access-Control-Allow-凭证:是的 我把它添加到我的jquery $ .ajax: xhrFields:{ withCredentials:是的 } 绝对没有用。 我正在做$ .ajax 输入:’POST’, dataType:’json’ 我想通过设置上面的所有标题,我可以做json而不是jsonp(请不要jsonp。除了jsonp之外的任何东西。我无法成功解雇。please.god.no) 我在极限。 我得到了好东西 XMLHttpRequest无法加载https://mysite.com/aDirectory/aSecureFile.php 。 Access-Control-Allow-Origin不允许使用Origin http://mysite.com 。 请帮忙。 我在这里死了。 我保证我到处都是,哦,我到处都看。 提前谢谢了! 明晰 […]