zend-framework

Zend_File_Transfer w/multiple files does not upload equally

白昼怎懂夜的黑 提交于 2019-12-21 20:40:56
问题 Weird title, yes, but the problem is simple; simply aggrevating. I have a form, that I built without using Zend_Form, and it has two file uploads: <input name="image" type="file" /> <input name="file" type="file" /> Here is the chunk of code from my controller that is handling the upload. There's actually a little more, but this is the relevant piece: $data['image'] = (isset($_FILES["image"]) && $_FILES["image"]["name"] ? $_FILES["image"]["name"] : NULL); $data['file'] = (isset($_FILES["file"

Magento, passing product name to contact form

白昼怎懂夜的黑 提交于 2019-12-21 20:38:50
问题 Hello from Magento beginer,i'm poor in knowledge of terms and names but i will try hard to explain this as much clear as i can. I'm currently working on configuration of Magento Contact Form to be able to collect some data from users on Product View Page . To be more interesting, the form will have also to send some data about the product on which page admin puts it, concretely Product name Not all products will have this form, only products that are available for supply in different

How do I Access my Models using a Daemon in Zend Framework

六眼飞鱼酱① 提交于 2019-12-21 20:07:01
问题 I am working on a project that is using Phirehose to collect and consume the Twitter Streaming API. The Phirehose library is designed to be run from the command line, preferably as a daemon or cron job. I created a daemon and placed it in the library folder. Bootstrap.php has been updated to autoload the custom library. So, the application itself has no problem seeing my daemon. My issue is how to integrate it properly with Zend Framework. I need to be able to call the daemon file directly to

Can i have multiple layouts in Zend Framework?

此生再无相见时 提交于 2019-12-21 19:54:05
问题 I have a flashy page with image rotators in the front end for the clients. For back-end I want to have different layout. Can i have multiple layout? A little hint would be appreciable 回答1: I create a layout plugin, to switch layouts when a non-default module is called: class MyApplication_Layout_Controller_Plugin_Layout extends Zend_Layout_Controller_Plugin_Layout { public function preDispatch(Zend_Controller_Request_Abstract $request) { switch ($request->getModuleName()) { case 'admin':

Zend Framework - Zend_Form Decorator Issue

浪子不回头ぞ 提交于 2019-12-21 18:25:30
问题 I have a class that extends Zend_Form like this (simplified): class Core_Form extends Zend_Form { protected static $_elementDecorators = array( 'ViewHelper', 'Errors', array('Label'), array('HtmlTag', array('tag' => 'li')), ); public function loadDefaultDecorators() { $this->setElementDecorators(self::$_elementDecorators); } } I then use that class to create all of my forms: class ExampleForm extends Core_Form { public function init() { // Example Field $example = new Zend_Form_Element_Hidden

Zend DB and encoding

会有一股神秘感。 提交于 2019-12-21 18:12:03
问题 I have just encountered something rather strange, I use the Zend Framework 1.10 with the Zend_Db_Table module to read some data from a databse. The database itself, the table and the fields in question all have their collation set to "utf8_general_ci" and all special chars appear correctly formatted in the DB when checked with phpMyAdmin. Also, saving with Zend_Db_Table works just fine, yet when I read the data and just echo it to my browser it is returned as ISO-8859-1, not as UTF8. I

Doctrine2 large collections

北城余情 提交于 2019-12-21 17:04:44
问题 I have been playing with doctrine2 + ZF setup for the last couple of days. One of the things I still can't figure out is the large array collection assosicaitons. For example let's say we have an entity called Post and each post can have many comments. <?php /** * @Entity */ class Post { /** * @OneToMany(targetEntity="Comment", mappedBy="post") */ protected $comments; } ?> Now this will load all comments if I do $post->comments But what if there are, say 10000 comments for this particular

Zend_HTTP_Client wont let me POST any data

不羁的心 提交于 2019-12-21 16:24:13
问题 I have been searching all over stackoverflow and Google for a solution to my problem. I have created two projects with Zend Framework - Project1 and Project2 - and I want to implement web services on one of them. The idea is to send a JSON-string to Project1 and receive back a JSON with all the details associated with that variable using POST. Now I have created a TestController on Project2 : public function indexAction(){ $uri = 'http://project1.com/WebService/data'; $config = array(

Create custom oAuth Server With Zend

我的梦境 提交于 2019-12-21 15:10:10
问题 is it possible to create a custom oAuth server with the Zend Framework Zend_Oauth? For example i want to create a REST service and have oAuth authentication? Does the zend framework have support for this out of the box?> 回答1: Currently, there is no working OAuth server/auth adapter. There are a few of us (including myself) working to meld the existing Zend_Oauth into a Zend_Auth_Adapter. Find me on twitter @onyxraven and we can discuss. I should have an idea of what needs done before the end

How to unit test calls to Google API

房东的猫 提交于 2019-12-21 12:49:40
问题 I have a following method, which retrieves top visited pages from Google Analytics: public function getData($limit = 10) { $ids = '12345'; $dateFrom = '2011-01-01'; $dateTo = date('Y-m-d'); // Google Analytics credentials $mail = 'my_mail'; $pass = 'my_pass'; $clientLogin = Zend_Gdata_ClientLogin::getHttpClient($mail, $pass, "analytics"); $client = new Zend_Gdata($clientLogin); $reportURL = 'https://www.google.com/analytics/feeds/data?'; $params = array( 'ids' => 'ga:' . $ids, 'dimensions' =>