Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
weierophinney opened this issue Dec 31, 2019 · 2 comments
Open

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

weierophinney opened this issue Dec 31, 2019 · 2 comments

Comments

@weierophinney
Copy link
Member

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 zendframework/zend-form#165

@weierophinney
Copy link
Member Author

Bump


Originally posted by @aimfeld at zendframework/zend-form#165 (comment)

@scutze
Copy link

scutze commented Sep 21, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants