zend-framework

Specifying SOAP Headers for a Zend_Soap Service

I have a generally straight forward web service that I've written (converting code to ZF from a Java implementation of the same service and trying to maintain the same wsdl structure as much as possible). The service loads a PHP class, rather than individual functions. The PHP class contains three different functions within it. Everyth...

Disable Zend Autoloader

How can I disable the Zend_Loader_Autoloader? ...

How to start testing Zend Framework Models?

How do I begin testing my models in a Zend Framework 1.8+ application? Let's say I have my application set up to start testing. I have already tested a controller, so I know it works. I have all my controllers extending my ControllerTestCase.php file: <?php require_once 'Zend/Application.php'; require_once 'Zend/Test/PHPUnit/Controller...

How to set current user in View?

I am using Zend Framework. I want the current user (if logged in) to always be available to the view. In my Bootstrap.php file I currently have: function _initViewHelpers() { $this->bootstrap('layout'); $layout = $this->getResource('layout'); $view = $layout->getView(); // <snip> $view-> set some stuff $v...

Zend PHP Class Variable retention for mysql queries

I have a flash application which uses a single php file to retrieve records from a database (using the Zend framework). When the application first begins, I make a call to the php to set a class variable, so that all future requests to the database will use this variable to select records based on its value. So here is how the class begi...

PHP Zend doesn't display correctly

I am trying to recreate the following blog's tabbed forms for my website. http://zendguru.wordpress.com/2009/01/15/zend-framework-and-dojo-creating-tabbed-form/ I currently have the form displaying on my page, however instead of tabs it displays the whole form like normal. I know that the form is displaying the subforms as I have com...

How to setup a Zend_Application with an application.ini and a user.ini

I am using Zend_Application and it does not feel right that I am mixing in my application.ini both application and user configuration. What I mean with this is the following. For example, my application needs some library classes in the namespace MyApp_ . So in application.ini I put autoloaderNamespaces[] = "MyApp_". This is pure applic...

How do the popular PHP frameworks handle Form Input Errors?

I know for example the Zend Framework has some capability for creating form elements with validators. But now, lets say the user enters complete garbage data, which is invalid. What would happen next? Lets say the JS part goes wrong or JS is disabled, and the server receives the garbage data. How do the "big" PHP frameworks handle this...

How to add localization in the URL using the Zend Router

I have a Zend Framework site that setups all routes in a file, routes.ini. The routes look like this: routes.popular.route = popular/:type/:page/:sortOrder routes.popular.defaults.controller = popular routes.popular.defaults.action = index routes.popular.defaults.type = images routes.popular.defaults.sortOrder = alltime routes.popular.d...

Zend_Controller_Router_Route_Hostname with additional variable

I'm having a problem with chaining some routes using another variable at the end. I'm using wild card sub domains. Like this: http://eric.mysite.dev/mypage1 mypage1 is going to be a GET variable. So what I want is http://mysite.dev/donate/now/index/id/eric/pagename/mypage1 I have it working fine without the pagename like this: $router=...

Strategy for unique user-voting such as Stackoverflow's?

I noticed that for voting SO implements an XHR method which POSTs to a posts controller and sends the post ID and vote type through the URL, in addition a fkey parameter is sent, eg: http://stackoverflow.com/posts/1/vote/2 I'm going to be implementing a similar technique, I'm wondering what logic I could use to prevent duplicate votin...

solved: zend_form access parent form element

Ok, I think I did my due diligence here. I couldn't find any reference on how to use a parent form element in a subclassed form. May be because it's obvious to everyone but me. It's got me stumped. This is what I tried. At first, within my form constructor I called parent::__construct($options = null); then accessed the parent elemen...

Practical Zend_ACL + Zend_Auth implementation and best practices

Context: My questions pertain to a forum I'm developing pretty much exactly like SO, where there are: guests who have access to view threads but can't reply or vote members who, with enough rep, can edit/vote others threads, and by default they can reply and have the same privileges as guests admins who can pretty much do anything I...

How to create an AJAXified form within the Zend Framework

I'm trying to create a contact form. However at the top of the form the user can select using radio buttons whether he's contacting the technical department or the marketing department. Depending on which he selects, the entire form changes. How would this be implemented within the Zend Framework? I'm already extending Zend_Form to mak...

What is the correct way to set up an observer in Magento?

I'd like to set up an observer in Magento that performs an action when the status of an order changes. I'm familiar with process of creating modules. What I'm looking to understand is what needs to placed in the modules config.xml, and what is the naming convention for the classes and/or methods that need to be created. ...

Zend Lucene segment sizes

I'm getting errors on a Zend FW site (I'm not that familiar with), stating: [message:protected] => Largest supported segment size (for 32-bit mode) is 2Gb I found this after noticing the search function on this site stopped working. I'm not sure if "segment size" is the same as the index size, but the folder containing the 3 indexes ...

Zend_Date language translation

Hello ! I have a function that returns me a date string using Zend_Date. $date = new Zend_Date(); $date->setOptions(array('format_type' => 'php')); $date->setTimestamp($timestamp); return $date->toString($format); When I set $format to 'l, d F Y' I expect something like: Środa, 13 stycznia 2010 (correct polish string what means W...

Embedding persistent login form Zend

I've seen this question asked already - but none of the answers really gelled for me, so I'm asking again: I want to embed a persistent login form (which will change into a nav bar if logged in) in the header bar for a site. Effectively, I want to be able to inject some controller logic into the layout. After much research, I can see se...

Redirecting URL with variable in Zend Framework

Whats the recommended method for redirecting with variables in Zend Framework? Lets say we have an action like this within a controller: public function newAction() { $form = new Form_ApplicationForm(); if($this->_request->isPost()){ $data = $_POST; if($form->isValid($data)){ ...

Strange error with zend frame work

Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[28000] [1045] Access denied for user 'liveaide_dbuser1'@'lynx-u.znetindia.net' (using password: YES)' in /home/liveaide/public_html/aider20test/zyberops/library/Zend/Db/Adapter/Pdo/Abstract.php:144 Stack trace: #0 /home/liveaide/public_html/aider20test/zyb...