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.
Options

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:
Controller_Method_Create()
But how can I apply that to Gdn_Form or other "core" classes? Doing this:
Form_NewMethod_Create()
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

Comments

  • Options
    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?
  • Options
    LincLinc Detroit Admin
    edited July 2010
    Hmm, "overload" was perhaps the wrong term. I'm talking about "Magic Methods" (#4 on http://vanillaforums.org/page/Plugins). Shouldn't I be able to add magic methods to any class?
  • Options
    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.
  • Options
    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.
  • Options
    LincLinc Detroit Admin
    bompz?
Sign In or Register to comment.