Tagged: zend

Zend Framework Logo 0

Disable Zend View Renderer

In case you need to disable Zend View’s Renderer because you want to return custom data (JSON, XML, etc.) simply using the following lines to do so: Then you can return your response in any format you want, just don’t forget to set the content type accordingly. That’s it.

Zend Framework Logo 2

Custom Zend_Form view script

Sometimes Zend’s built-in form decorators are not flexible enough to achieve customized views. Luckily, Zend provides means to specify custom view scripts. The following example demonstrates how to set and handle such a script. First and foremost, in your default (action) view script simply output the form as usual: Then,...

Zend Framework Logo 0

Control Zend’s layout rendering and Content-Type specifications

In case you need to return content types other than the one set by server (Apache, etc.) or Zend itself use the following lines to quickly control Zend’s layout rendering and Content-Type specification. This is crucial for instance if your controller is required to return JSON or XML as part...

Zend Framework Logo 0

Zend_Mail Plugin abstraction class

From time to time it is handy to be able quickly set special options when sending mails using Zend_Mail, such as automatically adding footer text or toggling between HTML and plaintext mails. In order to satisfy these needs I wrote the following simple abstraction class as a wrapper around Zend_Mail.

Zend Framework Logo 0

File Uploads using Zend_Form

File uploads can be managed quite easily using Zend_Form. First off, create a Zend_Form instance and add a Zend_Form_Element_File element, representing the file-input element. Make sure to set the encoding type to multipart/form-data: Now that we have a form let’s add the logic in the corresponding controller. We only need...

Zend Framework Logo 0

Custom Zend Validator for Localized Numbers

When dealing with i18n web applications the need to support localized number representations becomes obvious. Thus, users should be able to enter localized numbers such as “1.000.50 $” when for instance using the locale en_US or “1,000.50 $” when using de_AT. Now, when it comes to validating user input throughZend_Form...

Mehrseitige Formulare mittels Zend Framework umsetzenImplementing multi-page forms using the Zend Framework 40

Mehrseitige Formulare mittels Zend Framework umsetzenImplementing multi-page forms using the Zend Framework

Unfortunately, the Zend Framework (ZF) version 1.x currently does not provide a standard way or class to implement multi-page forms based on Zend_Form. Due to the fact that this is a very common use case I will try to explain a working solution to overcome this problem. Basically, the goal...

Zend Framework Logo 0

Zend 1.11.6 and Doctrine 1.2

Recently, our project team spent quite some time figuring out a way to get Zend (ZF) working together with Doctrine ORM. Although there are a lot of howtos and guides out there it seems like everybody has his/her own way of merging these two frameworks. In order to get most...