HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Form class

edited March 2015 in General Banter

Hi. How can I overwrite Gdn_Form class methods in theme?

Comments

  • Are you looking to override the entire class, or just a specific method?

    You should be able to extend the Gdn_Form class and then install your custom class via Gdn::FactoryInstall() in /conf/bootstrap.late.php.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Specific method (Radio, Checkbox).

  • Can you give me an example? I want call $this->Form->CheckBox, and get my method.

  • @hgtonight said:
    Are you looking to override the entire class, or just a specific method?

    You should be able to extend the Gdn_Form class and then install your custom class via Gdn::FactoryInstall() in /conf/bootstrap.late.php.

    Thank you! It's work!
    Gdn::FactoryInstall('Form', 'Custom_Gdn_Form', NULL, Gdn::FactoryInstance);

Sign In or Register to comment.