Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
override Gdn_Form->Button
elpas0
New
Hello guys
Is it possible to override Gdn_Form->Button without changing core files
I understand that i can rename Button to xButton, but i do not want to change core files - this will lead to problems with update
0
Best Answer
-
S ✭✭
I assume that you can call xButton in your script.
$this->Form->xButton('Save')
then you can useGdn_Form_Button_Override
in your plugin.0
Answers
I assume that you can call xButton in your script.
$this->Form->xButton('Save')
then you can use
Gdn_Form_Button_Override
in your plugin.What problem you are trying to solve using override
Gdn_Form::Button()
?I need to update button html code to smth like
<button type="submit"><span>Text</span></button>
to change buttons html on whole site and apply my css to it.
I thought about using
$this->Form->xButton('Save')
, but in this case i need to update all templates that use Form->Button functionI don't know if its the best option you could do it with a plugin with jQuery.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
yes, using jquery is also an option, but i would prefer to avoid it