Form class

edited March 2015 in General Banter

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

Comments

  • hgtonighthgtonight ∞ · New Moderator

    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.

    BleistivtShadowdarephalc0nline
  • 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);

    Bleistivthgtonight
Sign In or Register to comment.