zend-framework

Zend_Validate_Db_RecordExists with Doctrine 2?

China☆狼群 提交于 2019-12-12 09:42:35
问题 I'm using Doctrine 2 in a Zend Framework application and require functionality similar to Zend_Validate_Db_RecordExists and Zend_Validate_Db_NoRecordExists. For example, when a user enters a new item, I need to validate that a duplicate entry doesn't already exist. This is easy to accomplish with Zend_Db by adding the Db_NoRecordExists validator on my forms. I tried implementing the custom-validator solution proposed here, but I can't figure out how they are communicating with Doctrine to

Possible disadvantages of Zend [closed]

主宰稳场 提交于 2019-12-12 09:35:11
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago . I've started using Zend Framework and Studio for my projects and would like to hear from those who already use it what to expect. I'm

How to have a decorator applied as a default for all forms in Zend_Form?

六眼飞鱼酱① 提交于 2019-12-12 09:27:51
问题 I need to display form-level errors in my forms (errors that do not belong to one field, but to the whole form submission), with this code: $form->addError($message); For this to work, I need to add the relevant decorator to my form: $form->addDecorator('Errors'); Fairly easy. The problem is that applying a new decorator causes all default decorators to be removed, thus forcing me to re-apply all of them: $form->addDecorator('Errors') ->addDecorator('FormElements') ->addDecorator('HtmlTag',

Magento: Programatically update cart via event

北战南征 提交于 2019-12-12 09:27:49
问题 I'm hooking into the sales_quote_save_after event disaptcher. Firstly as a test I'm trying to get the items in the cart and change their prices to 0. After I do that I'll be building in some other stuff. I'm having trouble. I can change the unit price no problem, but when I go to recalculate the cart totals the prices are reverting back to the original price. public function sales_quote_save_before($observer) { if (Mage::registry('basket_observer_executed')) { return $this; } $quote =

Zend Routes translate URL's

坚强是说给别人听的谎言 提交于 2019-12-12 09:09:29
问题 1) I have a controller "calendar" and have action "showDate" which gets date via url. So, url is something like "calendar/show-date/date/2012-07-22" 2) I have a link to display all entries, "calendar/" So, I want to create routes so my links look like "kalendar/2012-07-22" and "kalendar/". Can anyone help me? 回答1: According to this post: http://www.z-f.fr/forum/viewtopic.php?id=5138 The solution is to add '@locale' => $lang to the params. $this->url(array('lang'=>'it','@locale'=>'it')) It

XMLRPC Zend_Http_Client_Adapter_Exception' with message 'Read timed out after 10 seconds

痞子三分冷 提交于 2019-12-12 09:02:47
问题 I've Googled everywhere but no one has posted a solution, they all say to set the timeout in the config but how do you do this? How do I reset/override this setting from my XMLRPC client or server? Here is what I'm trying: $server = new Zend_XmlRpc_Client('http://127.0.0.1/xmlrpc'); $client = $server->getProxy(); // Increasing the timeout $client->setConfig(array('timeout'=>30)); Here is the error: Fatal error: Uncaught exception 'Zend_XmlRpc_Client_FaultException' with message 'Method

“IS NULL” in Zend_Db_Table select not working

喜欢而已 提交于 2019-12-12 08:48:36
问题 I'm trying to do a join on 2 tables in Zend, using the DbTable / model / mapper structure. If, in my mapper, I do this: $select = $this->getDbTable()->select(Zend_Db_Table::SELECT_WITH_FROM_PART) ->setIntegrityCheck(false) ->join('images', 'images.oldFilename = availablePictures.filename') ->where('images.ref IS NOT NULL'); $resultSet = $this->getDbTable()->fetchAll( $select ); it works like a charm, but if I try the same thing with IS NULL instead of NOT NULL, I get nothing where I should

Zend Validation Db_NoRecordExists and exclude option

自古美人都是妖i 提交于 2019-12-12 08:44:13
问题 I'm trying to use the "exclude" option for a Db_NoRecordExists validator, cause when I'm "editing" the element it always return me back a "duplicated" error, as usual. What I aim to is to tell to the form to keep back the value passed to the form itself from the Controller... This is the Controller: public function editAction() { $id = $this->getRequest()->getParam('id'); $pagesMapper = new Application_Model_PagesMapper(); $form = new Application_Form_PageEdit(); $form->populate($pagesMapper-

call_user_func_array vs. call_user_func

╄→гoц情女王★ 提交于 2019-12-12 08:38:47
问题 I ran across an interesting issue today. We have an application that utilizes Zend Frameworks caching functionality. A request to this application typically calls a factory method using the following line $result = call_user_func_array(array("myclass", "factory"), array($id)); The idea is to return an object from the factory method that we can access later on. When we implemented a caching feature, this call just, well, dies. No errors, just a white screen. Nothing in the error log. We can

ASP.Net MVC or Zend Framework. What is your opinion [closed]

ⅰ亾dé卋堺 提交于 2019-12-12 08:22:31
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I am looking to start a new project and I am trying to decide which framework to go with. I have been using ASP.Net for a while and enjoy it. My first introduction to web applications was with PHP and I still love it. The project should be a medium sized project maintained by