laminas / laminas-form

Validate and display simple and complex forms, casting forms to business objects and vice versa
https://docs.laminas.dev/laminas-form/
BSD 3-Clause "New" or "Revised" License
81 stars 53 forks source link

FormRow helper doesn't invoke the FormLabel helper anymore #14

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

The FormRow helper used to call the invoke() function of the FormLabel helper in earlier versions of zend-form (e.g. 2.7.0), but not anymore. I noticed this because we override the FormLabel helper with a new invoke function, which is now ignored.

I think this line of code here should be changed back to

$label = $labelHelper($element);

As it used to be in zend-form 2.7.0. Otherwise, the __invoke() function of the FormLabel helper never gets called.

Or am I missing something here? Is there another way now to override the behavior of the FormLabel helper?


Originally posted by @aimfeld at https://github.com/zendframework/zend-form/issues/165

weierophinney commented 4 years ago

Bump


Originally posted by @aimfeld at https://github.com/zendframework/zend-form/issues/165#issuecomment-436564134

scutze commented 2 years ago

In case someone stumbles upon the same symptom after an upgrade to laminas: FormRow in Laminas uses the string 'form_label' (instead of the former 'formLabel') to identify the helper. So you might have to use that alias in the view_helpers section of your config file.

EDIT: However, you are right, as even with the correct settings, the FormLabel helper is not invoked.