Quantcast
Channel: Zend Framework – Rob Allen's DevNotes
Browsing all 21 articles
Browse latest View live

Using your own View object with Zend_Application

Let's say that you want to use your own view object within your Zend Framework application. Creating the view object is easy enough in library/App/View.php: class App_View extends Zend_View {     //...

View Article


Zend Framework View Helpers

I can't seem to find an article here that consolidates my thoughts on Zend Framework's view helper system, so I thought I'd better correct that. Zend Framework's Zend_View component supports helper...

View Article


Image may be NSFW.
Clik here to view.

A Zend Framwork compound form element for dates

A while ago I needed to ask a user for their date of birth on a Zend_Form. The design showed three separate select elements to do this: A little bit of googling found this site...

View Article

Exploring Zend_Paginator

One area of displaying lists on web pages that I've generally disliked doing is pagination as it's a bit of a faff. Recently, I needed to do just this though as I couldn't delegate it as my colleague...

View Article

Zend_Config_Ini and a string

One thing that is different between Zend_Config_Xml and Zend_Config_Ini is that with Zend_Config_Xml you can pass in an XML string as the first parameter of the constructor and it will work. This...

View Article


One-to-many joins with Zend_Db_Table_Select

Let's say that you want to set up a one-to-many relationship between two tables: Artists and Albums because you've refactored my ZF1 tutorial. Let's assume that an artist has many albums. These are the...

View Article

Unit testing Zend Framework 1

As part of our release process for Zend Framework 1.12, I've been working through the unit tests and running them on PHP 5.2.4 as it seems that recent changes weren't being tested with that version....

View Article

Vagrant in Zend Framework 1

I recently added support for vagrant to the Zend Framework codebase to enable easier testing. I was motivated by some work the joind.in folks have done to get a working development environment for...

View Article


ZF1.12 is released

I'm extremely happy to note that Zend Framework 1.12 has been released and is available here. The key changes are: ZF2's StandardAutoloader and ClassMapAutoloader have been back ported to...

View Article


Zend Framework 1 is not dead; ensure you upgrade!

I'm delighted to announce that Zend Framework 1.12.1 has been released! This release fixes 50 issues which is a great result. I'd like to thank everyone who submitted a patch to ZF1 and to Matthew...

View Article

Sending attachments in multipart emails with Zend\Mail

I've written before about how to send an HTML email with a text alternative in Zend\Mail, but recently needed to send an attachment with my multipart email. With help from various sources on the...

View Article

Using ZF2 Forms with Twig

Following on from looking at how to integrate Zend Framework 2 forms into Slim Framework, let's look at the changes required if you also happen to want to use Twig. When it comes to rendering the form,...

View Article

Validating JSON with ZF2's Zend\Validator

Let's say that you have an admin form where the user can enter JSON and you'd like to validate that the JSON parses before allowing the user to submit. To do this, you can use the rather excellent...

View Article


Exclude elements from Zend\Form's getData()

If you need to exclude some elements from a Zend\Form's getData(), the easiest way is to use a validation group. For example: class SomeForm extends \Zend\Form\Form implements...

View Article

ZF2 validator message keys

In Zend Framework 2, if you define your input filter via configuration, then you can override validation messages using a format along the lines of: <validators> <notEmpty> <messages>...

View Article


Replacing Pimple in a Slim 3 application

One feature of Slim 3 is that the DI container is loosely coupled to the core framework. This is done in two ways: The App composes the container instance rather than extending from it. Internally, App...

View Article

Zend\Input and empty values

I'm forever getting confused about how the combination of Zend\Input's required, allow_empty & continue_if_empty interact with an empty value, so I've decided to write it down. These settings...

View Article


Zend\Input fallback value

Recently an issue was reported against Zend\InputFilter where the reporter has discovered a regression where the fallback value wasn't being populated correctly. Matthew investigated, fixed it and...

View Article

Simple way to add a filter to Zend-InputFilter

Using Zend-InputFilter is remarkably easy to use: use Zend\InputFilter\Factory as InputFilterFactory; // set up InputFilter $specification = [ 'my_field' => [ 'required' => false, 'filters' =>...

View Article

Displaying errors in Expressive with Twig

If you're not using the Whoops error handler with Expressive and are using the Twig renderer, then you are given no information about the problem that occurred, even in debug mode. To fix this, I...

View Article
Browsing all 21 articles
Browse latest View live