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

Already on GitHub? Sign in to your account

FormRow option not to render label #4234

Closed
sparrowek opened this Issue Apr 15, 2013 · 7 comments

Comments

Projects
None yet
6 participants

It would be usefull to have an option for formRow view helper to turn off label rendering similar to setRenderErrors(). E.g. for HTML5 rendering you may want to use placeholders instead of element labels. Now you are forced to hide labels using CSS or to replace formRow with call to element helper and error helper.

Contributor

pauloelr commented Oct 16, 2013

In fact you can render only the form element without the label using the FormElement view helper as described here:
http://framework.zend.com/manual/2.2/en/modules/zend.form.view.helpers.html#formelement

Member

froschdesign commented Oct 16, 2013

@pauloelr
There is a difference: the FormRow helper outputs also the error messages of the element and adds an error class to the element. The FormElement helper outputs only the element.

@sparrowek
👍

Contributor

grizzm0 commented Oct 16, 2013

Simply skip label in the options array and put placeholder in the attributes array. And voila, FormRow will render exactly what you want. Btw, this issue is 6 months old...

Contributor

pauloelr commented Oct 16, 2013

Yeah, i know... i was just reviewing old issues to check if they should be closed
So if it's not anymore an issue i think it should be closed. Right?

Contributor

ThaDafinser commented Mar 10, 2014

ping @Maks3w closeable?

It could in theory be implemented like option $renderErrors option, but that would bloat the method even further...: https://github.com/zendframework/zf2/blob/master/library/Zend/Form/View/Helper/FormRow.php#L86

Member

froschdesign commented Apr 16, 2015

ping @Ocramius
Please close this issue!

@Maks3w Maks3w closed this Apr 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment