Reserved word `flags` in Zend Framework 1 causing Form issues

I recently found a strange issue when coding a form using ZF1’s Zend_Form in combination with checked checkboxes.

The code:

The issue:

The first 3 checkboxes are getting displayed normally, with banana and apple pre-checked. The second multiCheckbox renders, but does not have any checkboxes checked.

Why:

In my case I got it working when I renamed 'multiCheckbox', 'flags', array( to for example 'multiCheckbox', 'matchingFlags', array(.

Conclusion: flags in Zend_Form is a reserved word causing issues.

Leave a Reply

Your email address will not be published. Required fields are marked *