Hotfix/label submit #26

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants

Addresses Issue #9: Button label when not using display group

#9

I, too, am seeing labels rendered for submit buttons.

This fix is a quck hack that creates a Label decorator extending Zend_Form_Decorator_Label that simply bails if the element is a submit button; otherwise, it passes along to the parent.

These } else { here, doesn't make sense as you are returning the $content on the first conditional.

Owner

papayasoft replied Aug 18, 2012

Only when the element being decorated is a button. But the decorator is used on other elements (text input fields, for example), as well. The intent is to suppress the label on the buttons only.

Hi David,

Thanks for your PR. I think to write a new Label decorator to override the default Label decorator it's not the best solution for this issue. I think the way to go, is to override the default Twitter_Bootstrap_Form_Element_Submitdecorators on the element's __constructor or in some similar place where the decorators could be overriden.

Christian.

Owner

papayasoft replied Aug 18, 2012

OK, it was just a hack that got me over my own project-specific rendering hump. Thought it might be helpful to you or others. Feel free to close the PR.

In any case, thanks for consideration and for a great project that fills a nice niche for users of both ZF and Bootstrap.

Cheers! ;-)

David

@theUniC theUniC closed this Aug 18, 2012

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