zend-framework

Getting $_GET parameters from route in Zend Framework 2

帅比萌擦擦* 提交于 2019-12-09 06:12:33
问题 Zend Framework 1 had a very simple way of parsing URL routes and setting found params in the $_GET superglobal for easy access. Sure, you could use ->getParam($something) inside the controller, but if the param was found in the URL, it was also accessible via $_GET. Example for url mypage.com/mymodule/mycontroller/myaction/someparam/5: ZF1 $this->getParam('someparam'); // 5 $_GET['someparam']; // 5 ZF2 $this->getEvent()->getRouteMatch()->getParam('someparam'); // 5 $_GET['someparam'] //

get an array of all a products attributes in magento

巧了我就是萌 提交于 2019-12-09 04:39:28
问题 I cannot figure this out! I am trying to get a list of a products attributes into an array on the list.phtml page. I have tried everything. I have seen a lot of solutions that use $attributes = $product->getAttributes(); but I cannot get this to work, it just brings up a blank page. Any help would be greatly appreciated, I have spent hours and hours on this so far... I am using Magento version 1.4.2.0 UPDATE: Here is exactly what I am trying to do: $neededAttributes = Mage::helper('mymodule')

How to generate random password, or temporary URL, for resetting password in Zend Framework?

Deadly 提交于 2019-12-09 04:13:34
问题 I have a basic authentication process that uses Zend_Auth_Adapter_DbTable . I have login and logout actions on my Authentication Controller. Now I want to create a function to reset forgotten passwords by automatically generating a password, saving the new password, and sending them an email with the newly generated password. What would be the best process to go about doing this? How should I generate a new password? Does the Zend Framework have anything that would make this easier? I have

Is there a way to do an “INSERT…ON DUPLICATE KEY UPDATE” in Zend Framework 1.5?

前提是你 提交于 2019-12-09 04:05:37
问题 I would like to use ON DUPLICATE KEY UPDATE in Zend Framework 1.5, is this possible? Example INSERT INTO sometable (...) VALUES (...) ON DUPLICATE KEY UPDATE ... 回答1: I worked for Zend and specifically worked on Zend_Db quite a bit. No, there is no API support for the ON DUPLICATE KEY UPDATE syntax. For this case, you must simply use query() and form the complete SQL statement yourself. I do not recommend interpolating values into the SQL as harvejs shows. Use query parameters. Edit: You can

Zend cache frontend configuration

与世无争的帅哥 提交于 2019-12-09 02:40:25
Zend_Cache can be configured to cache several types of output, including the results of function calls, the results of object and static method calls, entire pages, and configuration data. Given this controller and related views how would you go with caching?From what some of you suggested here (see @marcin) I understood that clearing the whole cache for just a single comment or a post-update would be too much.How should I go for them to be cached separately? Basically I have a blog page where I'm loading all of the posts with relative users comments. -Index controller (home-page): class

Webkit and Excel file(PHPexcel)

元气小坏坏 提交于 2019-12-09 02:09:28
问题 I have an excel file which can be downloaded..for example NAME.xlsx well it works in firefox but in webkit(safari/chrome) it appends to the name also the extension .xhtml so then name it will be NAME.xlsx.html it should be ONLY .xlsx Here you have my headers: $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); $objWriter->save($root.'/application/to_excel/KSW.xlsx'); $this->getResponse()->setHeader('Content-type', 'application/download', true); $this->getResponse()->setHeader('Content

Know of any open source zend framework calendar?

老子叫甜甜 提交于 2019-12-09 02:04:20
问题 I'm trying to find an open source PHP calendar that will play nicely with my zend framework application. Ideally, I should be able to display the events on the public site, and add/edit/delete events in the admin section. Anything that would keep me from re-inventing the wheel so I can get a head start would be great. Update: At the moment, I have embedded a google calendar that I can update from the Google Calendar site, but I am still looking for something that has been done using the Zend

How to autoload Zend Framework module models?

北慕城南 提交于 2019-12-09 01:47:40
问题 I am building a new CMS in Zend Framework and I don't have much exposure to ZF. Client requires two sections called Admin and FE. So, I have structured my application structure as follows. - SITE -- application ---- configs ---- layouts ---- modules -------- default ------------ controllers ------------ forms ------------ models ------------ views ------------ Bootstrap.php -------- admin ------------ controllers ------------ forms ------------ models ------------ views ------------ Bootstrap

Zend Forms Module Include Paths

删除回忆录丶 提交于 2019-12-09 01:29:47
问题 I'm using Zend 1.8.4 and setting up a simple form test. My form class is located in './application/forms/SectorSearch.php' and the class name is <?php class Form_SectorSearch extends Zend_Form {...} My controller creates a new form in the init() method <?php class SectorController extends Zend_Controller_Action { function init() { $this->initView(); $form = new Form_SectorSearch(array( 'method' => '/public/sector/search', 'action' => 'post')); $this->view->form = $form; } .. } But i'm getting

Why doesn't this mail message decode correctly?

风流意气都作罢 提交于 2019-12-09 01:15:33
问题 I have this code. It's from the Zend Reading Mail example. $message = $mail->getMessage(1); // output first text/plain part $foundPart = null; foreach (new RecursiveIteratorIterator($mail->getMessage(1)) as $part) { try { if (strtok($part->contentType, ';') == 'text/plain') { $foundPart = $part; break; } } catch (Zend_Mail_Exception $e) { // ignore } } if (!$foundPart) { echo 'no plain text part found'; } else { echo $foundPart->getContent(); } What I can get is the message, that works fine.