Hi. How can I overwrite Gdn_Form class methods in theme?
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.
Gdn::FactoryInstall()
/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.
@hgtonight said: Are you looking to override the entire class, or just a specific method?
Thank you! It's work! Gdn::FactoryInstall('Form', 'Custom_Gdn_Form', NULL, Gdn::FactoryInstance);
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.
Thank you! It's work!
Gdn::FactoryInstall('Form', 'Custom_Gdn_Form', NULL, Gdn::FactoryInstance);