zend-framework

Running a ZendFramework project inside a subdirectory

南楼画角 提交于 2019-12-11 08:42:16
问题 I have a ZendFramework project that I would like to run inside a subdirectory. Currently my document root is at /var/www and the project is at /var/www/project with the various folders ( controllers , public , etc.) all within the project directory. I am trying to make it so that all requests from http://webserver/project/* are being passed to the /var/www/project/public/index.php file. However, trying to use the following code in /var/www/project/.htaccess to pass all requests does not work:

Pass a variable from postDispatch() to view instance in Zend Framework

允我心安 提交于 2019-12-11 08:41:01
问题 I have a controller plugin with postDispatch() hook, and there I have a $variable . How to pass this variable to the view instance? I tried Zend_Layout::getMvcInstance()->getView() , but this returns new view instance (not the application resource). The same with $bootstrap->getResource('view') . I don't want to pass it as a request param. Now, as a workaround I do it using Zend_Registry . But, is it the best way? 回答1: I've been using the ViewRenderer action helper to get the view when I need

Unable to find the socket transport “ssl” in Zend framework 1.12

断了今生、忘了曾经 提交于 2019-12-11 08:36:33
问题 i tried to sent email from my system but got this error messages. Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? i already see the others similar post but can't resolve my problem. i tried to change my code from "ssl" to "tls' but get1 the another error. Since i upload my project into University server, so i can't do anything with server configuration. This is my code so far : $config = array('ssl' => 'ssl', 'auth' => 'login', 'username' =>

Zend Framework: How to create controller in WINXP on command line

痞子三分冷 提交于 2019-12-11 08:27:42
问题 I am using zend framework with windows XP and WAMP server. I have created zend project using following DOS commands: SET PATH=%PATH%;C:\wamp\bin\php\php5.3.0 C:\>wamp\www> C:\wamp\www\ZendFramework\bin\zf.bat create project test and my project is created at: C:\wamp\www\test Now I have two questions. Q.1: In which folder I will run my create controller zend command using DOS? C:\wamp\www\test> or C:\wamp\www\test\application\controller> Q:2 I have tried both above folder locations to run

How to use zend delete action in confirmation popup?

萝らか妹 提交于 2019-12-11 08:24:58
问题 I want to use a confirmation popup to delete my items, so this is my delete action : 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()-

Zend Framework double class menu active

元气小坏坏 提交于 2019-12-11 08:18:43
问题 I make a menu with Zend_Navigation. The trouble is that I detect a few times "active menu" that is, the "li" of the current page. Here is my navigation.xml <?xml version="1.0" encoding="UTF-8"?> <configdata> <nav> <home> <label>Accueil</label> <controller>index</controller> </home> <search> <label>Riads</label> <controller>search</controller> <action>index</action> <params> <q>allriads</q> </params> </search> <last> <label>Dernières Minutes</label> <uri>#</uri> </last> <promotion> <label

ZF: how to check GET request?

♀尐吖头ヾ 提交于 2019-12-11 08:18:30
问题 I have a form. There are two selectboxes which are cannot be 0: field1, field2. If I set POST method then it works fine. If GET - wrong. Here my controllers' part: $this->view->searchForm = new Default_Form_Parameters(); $data = $this->getRequest()->getParams(); if ($this->view->searchForm->isValid($data)) { } If I have following request then isValid returns false. That's ok. http://site.ru/?field1=0&field2=0 If I have another request like http://site.ru/?crash then isValid returns true. That

How to cancel orders using payment method in magento

安稳与你 提交于 2019-12-11 07:55:06
问题 I am creating an Open Source Extension for Magento. Its in very early stages. I am struggling with cancel orders problem. I found some solution here Magento - How can I run code when my order is canceled or refunded. But whenever I cancel an order it calls neither void (in case of only Authorize payment action) nor refund (in case of authorize-capture payment action). When I use capture-refund, It says the order cannot be cancelled. When I use authorize-void, It say's the order have been

Why are my params not showing up in the url?

我们两清 提交于 2019-12-11 07:48:10
问题 Why are my action and params not showing up in my url? I am using the zend 2 framework. I have a search action and a results action. Below is my search action (not using variables as I test): return $this->forward()->dispatch('Application\Controller\Index', array( 'action' => 'results', 'zip' => '12345', )); The route is a child of my home route. 'results' => array( 'type' => 'segment', 'options' => array( 'route' => 'results[/:zip]', 'defaults' => array( 'controller' => 'Application

How can I keep Zend Framework from wiping out an existing Session?

时光怂恿深爱的人放手 提交于 2019-12-11 07:46:43
问题 I've been given the not fun task of trying to marry a Zend framework instance to antique legacy code with out much modifying the legacy code. Part of this is a multipage form that takes in a heap of data, verifies it, processes it and then sends it to the websites owner in an e-mail. My job is to get that data into ZF where I can auto process it into a database. I cannot use POST. I'd rather like to avoid using an autosubmitting form as I don't think I'm supposed to be using Javascript. Get