BinaryKitten has posted an article on how do module specific bootstrapping within a module’s bootstrap class:
The Concept I wanted to achieve was to have unique Configuration based upon the module that was active. The Issue with this is that the Bootstrap files and the _init functions for ALL modules are called with no bias as to which module is active. Thus if you created a 3 modules wanted to make menu alterations in one, those alterations will be applied to all. I also wanted to have a a system where if i added extra modules i could just add extra functions to the bootstrap file and it would work in a similar way.
She then goes on to post a solution using a front controller plugin that calls back into the currently active module’s bootstrap to execute methods that start with _activeInit.
Go have a read! It’s a nice, extensible solution to the problem
Posted by Rob on 5th January 2010 under Around the web | 1 Comment »
Jon Whitcraft has posted an article explaining how to access Zend_Application resources from within a controller. He also points out that retrieving a resource from a module requires a little more work and helpfully provides the code required.
Posted by Rob on 10th December 2009 under Around the web | Comments Off
Juozas Kaziukenas has recently posted some examples of using Zend Framework with Doctrine on his github account.
Visit http://github.com/juokaz/php-examples and have a look!
Posted by Rob on 27th November 2009 under Around the web | Comments Off
Juozas Kaziukėnas has posted the first part of a series about Zend Framework and Doctrine:
After evaluating possible solutions I decided to stay with Doctrine for a long time. I don’t know any other solution coming, I definitely don’t want (mainly because I don’t have time) to invest on creating my own library and Doctrine is simply awesome when you get used to it. After all this time I can say that it was a right call – Doctrine is on a way to being officially supported in Zend Framework
He then goes on to talk about the benefits of Doctrine and why it can save time. Well worth a read and following the rest of the series.
Posted by Rob on 16th November 2009 under Around the web | Comments Off
There’s an interesting post over on the mrBurly blog about using action delegates to avoid having duplicate controllers.
One weekend after two years of working with the Zend Framework I threw together a basic application by perfecting one LIST/CRUD controller and then performing your standard copy/paste grepWin replace to create 4 others from it. I may have sensed a better way before that day, but on that day it was obvious that a better way existed. That “better” way in my opinion is the…
Delegation Pattern
Definitely well worth having a read.
Posted by Rob on 3rd November 2009 under Around the web | Comments Off
I’m transferring the domain name of this site to a new registrar, so there may be a bump or two when the DNS transfers.
Posted by Rob on 27th September 2009 under The Book | Comments Off
Thomas Weidner has recently blogged about two new filters coming to Zend Framework 1.10:
As you’d expect ZendFilterCompress and its counterpart ZendFilterDecompress handle compression and decompression from a number of formats including bzip2, gzip, zip and tar. Usefully the format support is via adapters so more can be added.
ZendFilterPostcode is locale aware and can validate the format of postcodes from around 150 different countries. I don’t know about you, but building the regex for postcode handling is tedious at best, so this will be a very useful component for me at least!
Full details on how to use these new filters are on Thomas’ site.
Posted by Rob on 20th September 2009 under Around the web | Comments Off
Tom Graham has recently posted about a component that he’s written that notices when a login form is being brute forced and then adds a captcha element to the form. I really like this idea as it doesn’t inconvenience genuine users at all.
In his own words:
The easiest method of preventing such attacks is to implement some kind of rate limit. Twitter now does this on their login form by adding a CAPTCHA that the user must solve after a number of failed login attempts. The theory behind this is that even if the attacker does manually solve the CAPTCHA it would sufficiently slow them down to make the brute force method unfeasible.
I had been doing a similar thing in one of my applications for some time, and eventually decided to move my code into a re-usable component.
He goes on to explain how to use it and how it works and has published the code on github.
I highly recommend checking it out.
Posted by Rob on 8th September 2009 under Around the web | Comments Off
Thomas Weidner has posted an article about how to set your own validation messages when validating emails.
It turns out that it’s quite tricky to do as ZendValidateEmailAddress uses ZendValidateHostname behind the scenes. He documents how it will be much easier to do in ZF 1.10:
I added a new feature which is available as with Zend Framework 1.10. With it you can set hostname messages from within the email validator… the above code can then be simplified to:
$validator = new Zend_Validate_EmailAddress();
$validator->setMessages(
array(
Zend_Validate_Hostname::UNKNOWN_TLD => 'I don't know your TLD',
Zend_Validate_Hostname::INVALID_HOSTNAME => 'I don't know your hostname'
Zend_Validate_EmailAddress::INVALID => 'Are you sure this is a email address?'
)
Very useful stuff.
Posted by Rob on 9th August 2009 under Around the web | Comments Off
Jason Houle has posted an article on how to use Dojo’s digit.Editor WYSIWYG editor with Zend Framework.
In one of my current projects, AircraftConnection.com, I decided to use the dijit.Editor WYSIWYG editor in my user’s forms. I ran into a few problems and could not find much documentation on the topic.
- I wanted the label, description, and field in a different order.
- I wanted the data entered into the editor to actually be passed to the server when the form was submitted.
- I wanted to pre-populate the form with data the user had previously entered.
He shows how to extend Zend_Dojo_Form_Element_Editor to provide a customised set to decorators and then goes on to show to to use it within a Zend Framework MVC application.
Check it out!
Posted by Rob on 22nd July 2009 under Around the web | Comments Off