Getting AngularJS and Zend Framework POST to play nice

I was simply posting data to the server using this code $scope.submit = function() { console.log($scope.newTitle + ' is the new title'); $http({ url: '/api/idea/method/add', method: 'POST', data: { title: $scope.newTitle, description: $scope.newDescription }, headers: {'Content-Type': 'application/x-www-form-urlencoded'} }) .success(function(data, status) { }) .error(function(data, status) { }); }; But I was getting a JSON object submitted and therefore using Zend’s _getParam('title') could not pick up the title in the post.

Poedit and phtml files giving error from xgettext

Problem I had just set up a Poedit for a project at work and was trying to update the *.po file with new translations. It wasn’t finding a whole load of them. After a while of poking around, it dawned on me that it was not looking in my phtml files. Simple enough, I just added *.phtml to the list of extensions in the parsers preference. Then I receive a big long error message that xgettext didn’t know what phtml.

PHP SimpleXmlElement values into an array

I have an XML string I was trying to parse for some values. The following XML was stored in a variable $xml C3399 Lion's Paw Shell Pendant Active 1 20.59 I used this to get to the values into an array. $xmlObj = new SimpleXMLElement($xml); $item = $xmlObj-children('ns0', TRUE); $data = array(); $data['Style'] = $item-Style; $data['Status'] = $item-Status; $data['Qty_Avail'] = $item-Quantity_Available; $data['Price'] = $item-Wholesale_Price; But when I did a print_r(data);, I would get this junk.

Zend_Loader_PluginLoader_Exception

For the top alerts you get after you’ve saved a page or some other event, there is the built in Flashmessenger in Zend Framework, but emanaton has put together a great messenger called PriorityMessenger. I had it running on one of my sites without issue, but when I tried to get it running on another site I get an error of. I had placed my PriorityMessenger.php file in: application/views/helpers/PriorityMessenger.php

Incorrect error message when enabling resources.session.save_path

To customize the session location I added the following to my application.ini file. resources.session.save_path = APPLICATION_PATH "/../var/session" resources.session.remember_me_seconds = 604800 ;; One week resources.session.gc_maxlifetime = 604800 After refreshing I encountered this error. Zend_Session_Exception: session has already been started by session.auto-start or session_start() in /usr/local/zend/share/ZendFramework/library/Zend/Session.php on line 462 This was a little misleading as I looking through my app to see if the session.auto_start or if I had called session_start() in the index.

Zend_Auth and RememberMe cookie sessions

It’s bad enough that we make people pick a new username / password to access our site, but even worse is by default Zend_Auth sets a cookie that expires when the browser is closed. Most sites have a “RememberMe” checkbox. This is handy so a user does not have to log into your site everytime. To accomplish this, you simply add the following lines AFTER the users has been authenticated on your site.

Doctrine Query Cache driver memcache when using ZFDoctrine

According to Doctrine’s documentation, you should always utilize a Query Cache. http://www.doctrine-project.org/documentation/manual/1_2/en/caching:query-cache-&-result-cache You should always use query cache in a production environment. That said, you can easily use it during development, too. Whenever you change a DQL query and execute it the first time Doctrine sees that it has been modified and will therefore create a new cache entry, so you don’t even need to invalidate the cache. That said, you need to add the following configuration options in application.

Zend_Tool and APPLICATION_ENV [SOLVED]

I’ve set up my project on a new server getting prepared to go live. With that comes, moving around some files getting things ready. One thing I’m working on it getting the Zend_Tool command line working. On the server, I’ve configured APPLICATION_ENV to be production via .htaccess Problem When I run zf.sh show doctrine it errors out because it’s trying to use my “development” DB config rather than the “production” one.

Zend Framework - Doctrine ORM strange Zend Tool behavior.

Zend Framework… awesome. Doctrine ORB… awesome. Both of these combined…. PURE AWESOME. I set up a project just at it says to on this page http://github.com/fmntf/zf-doctrine. It took some doing, but I got it working and was quite happy with my initial results. Then I needed to start a new project, so I just copied all the files, tweaked the DB name was flying with a new project… with one caveat.

Magento and Zend Server checkout redirect to cart [solved]

[![IMG_3623.JPG](http://farm3.static.flickr.com/2673/3850124015_1528c7e83c_m.jpg)](http://www.flickr.com/photos/14396219@N00/3850124015/) I installed Zend Server CE on one of my machines. The next day I noticed that you could not checkout from the website. It would bring you to the to the Billing Address, then after you hit “continue” it would redirect you back to the checkout page. No errors that I could see. Then I remember a problem I had many moons ago that was very similar and a forum comment jogged my memory.