zend-framework

Domain Objects and Value Objects - are they equal?

余生长醉 提交于 2019-12-21 12:19:06
问题 By looking to the example of a Domain Object into Zend Quickstart tutorial, and other examples considering a DAO/VO patterns, they both seem to be very similar. Can we deduce that to say "Value Object" is the same as to say "Domain Object" ? If not, can you please clarify the differences between those? What is the function of one, and what if the function of another ? I'm asking this because, both are composed by getters and setters and nothing more then that. It seems that, they do the same

Zend Framework PDF multiline problems

蓝咒 提交于 2019-12-21 09:39:25
问题 I have a problem, with Zend_PDF multiline, my problem is that I can't write the entire text to my pdf.My text looks like this: http://pastebin.com/f6413f664 But when I open my .pdf file, the text looks like this: http://screencast.com/t/1CBjvRodeZQd And here is my code: public function pdfAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $theID = ($this->_getParam('id') !== NULL) ? (int)$this->_getParam('id') : false; ($theID === false) ? $this->

Zend Form: Checkbox element displays as hidden field?

谁都会走 提交于 2019-12-21 07:38:53
问题 I would like to add a simple check box to my form: $element = new Zend_Form_Element_Checkbox('dont'); $element->setDescription('Check this box if you don\'t want to do this action.'); $form->addElement($element); However, this is what the html looks like: <dt id="dont-label"> </dt> <dd id="dont-element"> <input type="hidden" name="dontAttach" value="0"> <input type="checkbox" name="dontAttach" id="dontAttach" value="1"> <p class="description">Don't attach a bulletin. I only want to send an

Zend_Db: How to get the number of rows from a table?

眉间皱痕 提交于 2019-12-21 07:31:31
问题 I want to find out how many rows are in a table. The database that I am using is a MySQL database. I already have a Db_Table class that I am using for calls like fetchAll() . But I don't need any information from the table, just the row count. How can I get a count of all the rows in the table without calling fetchAll() ? 回答1: $count = $db->fetchOne( 'SELECT COUNT(*) AS count FROM yourTable' ); 回答2: Counting rows with fetchAll considered harmful. Here's how to do it the Zend_Db_Select way:

PHPUnit Code Coverage

风流意气都作罢 提交于 2019-12-21 07:24:18
问题 I am learning the ropes with Unit testing Zend Framework applications. So far I have set up PHPUnit to work with Zend Framework and have started writing some simple Test Cases. My issue is that I am wondering why Code Coverage does not work in spite of being set in the logging tag in my phpunit.xml . I don't get any error but no coverage report is generated. However it works when I run phpunit --coverage <dir> The logging section of my phpunit is as below: <phpunit bootstrap="./application

Zend_Service_Twitter - Make API v1.1 ready

荒凉一梦 提交于 2019-12-21 07:11:03
问题 The Zend_Service_Twitter component is still for Twitters API v1.0 which will be deprecated at 5th March 2013. So I wanted to make my new website with Twitter API interaction v1.1 ready. Everything works fine with v1.0 but if I change the URL from /1/ to /1.1/ it fails with the HTTP header code 400 and the JSON error message: Bad Authentication data (Code: 215) To get the request and access token stayed the same and works already without any changes, but if I want to verify the credentials

Get post data, Zend Framework

倾然丶 夕夏残阳落幕 提交于 2019-12-21 07:00:11
问题 I want to fetch posted data. But I am using no form. The data is postet by a jquery script with method post and I would like to fetch it. I know how to fetch parameters $id = $this->getRequest ()->getParam ( 'id', null ); and form values $message = $form->getValue ( 'message' ); however I want to access post data and not parameters or form values. Any ideas? 回答1: Here is my solution;) $this->getRequest()->getPost('id', null); 回答2: Actually, this might be more of what you're looking for. $this

Framework Comparison and Overhead

大憨熊 提交于 2019-12-21 06:24:44
问题 I am working on a Facebook game which is developed using Zend framework. Right now I don't have lots of traffic and already seen quite a large # of data usage / CPU time. Actually, I'm not good at Zend. I good at coding from scratch for both PHP & JS. so, I am curious about the performance of Zend framework. becuase I'm thinking about rebuilding the applciation using Zend as the backend to manage the data / session / logic. and use JS (native code or JQuery) for the front-end rendering UI and

Can I integrate a Zend-Framework powered web application into a wordpress site?

血红的双手。 提交于 2019-12-21 06:15:08
问题 I have a project in which I want to be able to call wp_list_pages() on a page that also uses the Zend Framework to power some complex interfaces manages custom data outside of wordpress. This page should also redirect the user to the wordpress login screen if they're not already logged in with the appropriate level of authorization. How would this work at a high level, i.e. do I need to edit the wordpress bootstrap file to conditionally implement the custom interface based on a specific URL

Zend form ajax validation on submit

Deadly 提交于 2019-12-21 05:35:36
问题 I am currently trying to validate a zend form with ajax and zend validate at the same time... Let me explain, my forms pops up in an iframe (fancybox) and when submitted, I need to display a "thank you" message, close the iframe and redirect the user. I planned to use ajax validation to close the fancybox iframe if success. I followed several tutorials http://www.zendcasts.com/ajaxify-your-zend_form-validation-with-jquery/2010/04/ explaining how to ajaxify your zend form to display errors for