zend-framework

JQuery Ajax fail and return exception?

依然范特西╮ 提交于 2019-12-12 03:17:52
问题 I have read a few posts on fail parameters for a JQuery Ajax call, but none that have directly answered my question. If you want to read up on my jumping off point here, this post would be a good start: jquery: is there a fail handler for $.post in Jquery? My problem is that there are a handful of things that may cause my application to fail - if my script returns false the above method would work just fine for me (if I understand it correctly), but most of the time my script will fail by

In Zend Framework Zend_Db_Table::getDefaultAdapter() returns Null

此生再无相见时 提交于 2019-12-12 03:13:57
问题 after serching up and down the internets, finding no proper answer, I am asking you: I want to implement a getAuthAdapter(array $form) private function getAuthAdapter(array $form) { $authAdapter = new Zend_Auth_Adapter_DbTable( Zend_Db_Table::getDefaultAdapter(), 'user', 'email', 'password', 'MD5(?) AND hidden = "FALSE"'); $authAdapter->setIdentity($form['email']) ->setCredential($form['password']); return $authAdapter; } To establish a database connection, I added following lines to my

phpunit throwing exception when doesn't find file with name of testsuite

扶醉桌前 提交于 2019-12-12 03:13:51
问题 I was following Jon´s screencast about Unit Testing with PhpUnit and ZF when I got the exact same error that ratzip described in this question. As he commented, I also had the same problem even after creating tests as suggested here: for some reason, there was some script looking for a file named as I named my test suite (MyApp.php or whatever...). I looked around but wasn´t able to find where I should create this file and what it should contains. But, in a given moment, after had read this

How to add an admin page for a custom widget in Socialengine 4

邮差的信 提交于 2019-12-12 03:08:59
问题 How can we create an administration panel page for a custom widget in social engine 4? I have not found any information regarding this over the internet. 回答1: You should create a controller, for example, 'AdminSettingsController.php' in application/modules/Yourmodule/controllers/ In this controller: class User_AdminManageController extends Core_Controller_Action_Admin Then create public function indexAction() inside. It will contain all your code related to your custom widget. After that you

Turn multidimensional array into single array?

眉间皱痕 提交于 2019-12-12 03:04:44
问题 I'm trying to turn a multidimensional array created by iterating over an array created by a shopping cart: Array ( [array] => Array ( [0] => Array ( [product_id] => 7 [prod_count] => 1 [price] => 19.99 ) [1] => Array ( [product_id] => 6 [prod_count] => 3 [price] => 19.99 ) [2] => Array ( [product_id] => 5 [prod_count] => 2 [price] => 19.99 ) [3] => Array ( [product_id] => 4 [prod_count] => 4 [price] => 14.99 ) [4] => Array ( [product_id] => 3 [prod_count] => 5 [price] => 19.99 ) ) ) into

Zend DB join selects all columns

与世无争的帅哥 提交于 2019-12-12 02:54:25
问题 I am attempting to perform a query using Zend_Db_Select. Here is my code: $db = $this->db; $select = $this->db->select(false) ->from('invoice',$data1) ->join('partner_settings', $db->quoteInto('partner_settings.clientid = ?', $clientid), array()) //'toggle_value')) ->join('partner_info', $db->quoteInto('partner_info.rowid = partner_settings.partnerinfoid', array())) //'type', 'shipper_name' => 'partner_info.name'))) ->join('partner_shipping', $db->quoteInto('partner_shipping.partnersettingsid

Synchronize in php or zend framework

守給你的承諾、 提交于 2019-12-12 02:53:57
问题 Is PHP has synchronize mechanism like Java? In my project different users can continue with same transaction. As example, I send a mail with payment details page URL to different user. So they can view that page at same time. Also they can continue to same transaction. I want deny (Show message) that page for users when one user already view the page. In java we can use synchronize for object. How can i do it in php or zend framework? 回答1: PHP is NOT like Java. Each request run in a separate

ZF2, pass variable to custom element from controller

我只是一个虾纸丫 提交于 2019-12-12 02:51:40
问题 In ZF2, I have a custom form element factory. It creates a custom MultiCheckbox and fills the checkbox values and labels from a db query. class MyMultiCheckboxFactory { public function __invoke(FormElementManager $formElementManager) { $multiCheck = new \Zend\Form\Element\MultiCheckbox(); $serviceManager = $formElementManager->getServiceLocator(); $mapper = $serviceManager->get('Path\To\Mapper\To\Query\DB'); $descriptions = $mapper->findDescriptions($id); // some processing to prepare $value

Caching whole html output with zend

人盡茶涼 提交于 2019-12-12 02:48:48
问题 I am trying to cache everything that is output by layout script and controller's action script using Zend_Cache but it is not working correctly. All I get is DEBUG HEADER : This is a cached page ! I got layout.phtml script and index.phtml script. Both produce html code. In my IndexController i put $frontendOptions = array( 'lifetime' => 7, 'debug_header' => true, 'regexps' => array( '^/$' => array('cache' => true), '^/index/' => array('cache' => true) ) ); $backendOptions = array('cache_dir'

Zend Form : Call to undefined method Zend\InputFilter\InputFilter::getFilterChain()

点点圈 提交于 2019-12-12 02:45:36
问题 I'm trying to upload an image with Zend Form. As we need it to move the image, I want to add a filter to do the job. But I can't use the getInputFilterChain(), I keep having this fatal error : Call to undefined method Zend\InputFilter\InputFilter::getFilterChain() . What am I missing here ? I'm able to get the file information in $prg array. And as I looked on https://framework.zend.com/manual/2.4/en/modules/zend.mvc.plugins.html, this method is supposed to exist here, no ? And I get the same