Category: Zend Framework

Magento Logo 0

Display localized dates in Magento

Since Magento uses the Zend Framework you are able to use Zend_Date to easily display localized dates in Magento. So, first create a Zend_Date object based on the locale set in the administration backend: Then simply output your date as localized string using Zend_Date->toString: Us usual, find formating rules in...

Doctrine Logo 5

Managing Doctrine 2 Entity Model mapping classes using YamlDriver in Zend Framework 2

This post continues my approach to integrate Doctrine 2 into Zend Framework 2 by additionally setting up YamlDriver to generate and manage Doctrine 2 Entity model mapping files. First, we need to install the YAML dependency symfony/yaml: And rebuild our project: In case you forget the install the symfony/yaml module...

Web-based KeePass(X) Management Tool 6

Web-based KeePass(X) Management Tool

KeePass and KeePassX are almost perfect tools when it comes to storing passwords and other sensitive information. Almost, since these tools currently only work offline and do not expose command line options out of the box. Since I want to access certain information on the road I was searching for...

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 0

Updating Select Options and InArray Validator in Zend Form

When using Zend_Form’s multi-select with dynamically set options you need to make sure to update your options and the InArray validator accordingly when validating data using form->isValid(). In order to update selection options and update the InArray validator we need to first set the options, remove the currently set InArray...

Web Interface for SMS Server Tools 3 4

Web Interface for SMS Server Tools 3

I have been using SMS Server Tools 3 (smsd) for numerous projects in the past due to its stability and configurability. Since smsd does not provide a graphical UI out-of-the-box I have decided to develop a web interface for users to be able to manage their SMS data, much like...

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...

Liste der von Google Currency Converter unterstützten Währungen (ISO-4217 Codes)List of currencies supported by Google currency converter (ISO-4217 codes) 5

Liste der von Google Currency Converter unterstützten Währungen (ISO-4217 Codes)List of currencies supported by Google currency converter (ISO-4217 codes)

The following is a list of ISO-4217 currency codes supported by Google’s currency converter available at After some research this list includes all of the most commonly used currencies world-wide (please leave a comment if you find any errors or missing entries). Thus. it can be used as a...