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.

How to overload Gdn_Form

LincLinc Detroit Admin
edited July 2010 in Vanilla 2.0 - 2.8
If I want to overload a model or controller, I can typically do this in a hooks file:
But how can I apply that to Gdn_Form or other "core" classes? Doing this:
doesn't work, and I've tried a number of permutations with the Gdn_ prefix, etc. Could I get the Cliff's Notes on this one? :D


  • ToddTodd Chief Product Officer Vanilla Staff
    Overloading core classes like that is currently not supported. I think allowing you to add new methods is something we can support, but the full before/after/replace is probably not in the cards.

    Is there something you want specifically that I can help get in?
  • LincLinc Detroit Admin
    edited July 2010
    Hmm, "overload" was perhaps the wrong term. I'm talking about "Magic Methods" (#4 on Shouldn't I be able to add magic methods to any class?
  • LincLinc Detroit Admin
    Ah, Gdn_Form doesn't extend Pluggable which is probably the root of that, right? Is there a reason it doesn't? I'm in a little over my head digging into that to determine performance issues or conflicts there.
  • LincLinc Detroit Admin
    Specifically, this is because I need more flexibility with Gdn_Form::Date, like the ability to optionally do times (like for scheduling an event) or omit the day (ex: credit card expiration). My first idea was to extend Gdn_Form with more methods.
  • LincLinc Detroit Admin
Sign In or Register to comment.