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

elpas0elpas0 New
edited April 2012 in Vanilla 2.0 - 2.8

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

Best Answer

  • SS ✭✭
    edited April 2012 Answer ✓

    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.

Answers

  • SS ✭✭
    edited April 2012 Answer ✓

    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.

  • SS ✭✭

    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 function

  • I 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

Sign In or Register to comment.