PHP

Zend Framework: View Helper Priority Messenger

Zend Framework's FlashMessenger is a well meaning and generally well constructed object, but which doesn't behave quite as I'd like, so I created this PriorityMessenger. My reasons for doing so center on the following two issues.

Zend Framework: Form Plain Text

I had several hacks in place in various Zend Framework based project for outputting plain text on a form and decided at long last to work from within the system again. The only solution that made sense to me was to create a Zend_Form_Element_Xhtml object that output as its value plain escaped text. Decorators can be added in the normal way to remake this control in as many forms as one might wish.

Zend Framework: Config Yaml

I was working on a RoR project and become comfortable with yaml files, so was disappointed to discover that Zend Framework doesn't provide support for yml files out of the box. Therefore, I've banged out the following Config_Yaml code, which is based largely on the Zend_Config_Xml and Zend_Config_Ini objects. I've implemented all of the Zend_Config functionality as of ZF version 1.7.8. If you see anything missing, please do let me know!

Zend Framework: Config Any

Since I was on a role with writing the ZExt Config Yml and ZExt_Config_Writer_Yaml objects, I decided to try something just a little off the beaten track. ZExt_Config_Any allows one to specify a config file of any supported type, leaving off the file extension, and having it correctly build the Zend_Config object. e.g., given the file "../application/config", this object will look in "../application/" for a xml, yml, and ini file, loading the first one it discovers using the appropriate object type.

Zend Framework: Config Writer Yaml

After writing the Zend Config Yml and Zend_Config_Any objects I realized that I wished to convert my existing ini files over to yml format, and so I banged out this code. I didn't really care for the format that the syck code generated, so have included a the option of passing in a boolean to format in my preferred style - see the inline documentation for an example of this.

implode_assoc

I was fiddling around on a project and created this associative array implosion function that incorporates several of the ideas from the php.net documentation's entry on implode, but which also adds a whack of nifty options. Documentation and examples are included in-line.

Zend Framework: Validate Identical Field

This little object is a canned and generic validator for Zend Framework. It is intended for use with Form Elements, but it should work fairly broadly. The basic need it addresses is to validate that one field value matches another (e.g. password/email and an associated validation field, a captcha challenge, etc.). I looked hard for a ready made answer to this issue, but after much searching and failed experimentation with other canned solutions I decided to write my OWN generic answer to the problem.

Syndicate content